Results 1 to 23 of 23

Thread: Script Finishes=Shutdown

  1. #1
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Script Finishes=Shutdown

    Well i like many other leave my laptop on overnight running scripts. I'm looking for a way to make when a script finishes to make the computer shutdown.

    For example, atm i am using Pvh's Edgevill Clay Softener and when i run out of clay (i only have around 7k each night) i would the script to end, and then shut the computer down. I am not sure if this needs to be a bit of script added onto the end, or a option changed on the computer? But thanks for all who took time in reading this! Help will be much appreciated

  2. #2
    Join Date
    Mar 2007
    Posts
    128
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Shutdown;

    .

  3. #3
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    SCAR Code:
    procedure ShutDownPC;
    begin
      if ShutDownYourPC then // Set as a const.
      begin
        WriteLn('');
        WriteLn('Shutting down your PC.');
        WriteLn('To stop it once it starts counting, go to Start, Run, then type ''shutdown -a''');
        Wait(2000);
        KeyDown(92);
        Wait(200);
        KeyDown(82);
        Wait(200);
        KeyUp(82);
        Wait(200);
        KeyUp(92);
        Wait(2000);
        SendKeys('shutdown -s -f -t 60 -c "Shutting down PC '+TimeRunning+'"');
        Wait(2000);
        KeyDown(13);
        Wait(200);
        KeyUp(13);
        Wait(160000);
        TerminateScript;
      end;
    end;

    Edit:
    Quote Originally Posted by Gone Fishing View Post
    Shutdown;

    .
    Lol?? Where is that procedure? -.-


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  4. #4
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    so how does that work Hy? I put that in script somewhere? and when i run out of clay its shuts down comp?
    Ty

  5. #5
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Just have it when it says it is out of clay, call that procedure, and it should shutdown


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  6. #6
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol sorry i am a noob at scripting, how do i make it call that procedure? and also, i dont know what it does when it runs out of clay i have never used it all before. Sorry for being so pathetic!!!

  7. #7
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    btw using smart, soz for double post but bout to go to bed so in rush, soz

  8. #8
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if (OutOfClay) then
      ShutDownPC;

  9. #9
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol yay now i got everything, but where do i put them, the shutdownpc is just a function i guess and is the
    if (OutOfClay) then
    ShutDownPC;
    a const? thanks everyone!

    I have no idea to use this, is there anyway some can tell me the whole script and how to use it, not just this script but also for others.

    Edit: TBH, i would much prefer it if there was a way if scar stopped, for example if a random stopped scar, the computer shut down. Thanks for everyone who read this!

  10. #10
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Something like this: if you don't get it, i will explain in depth.
    SCAR Code:
    program New;
    {.include SRL\SRL.scar}

    const Shutdown = True;

    function OutOfClay: Boolean;
    var
      x, y, bmp: Integer;
    begin
      Result := FindBitmap(bmp, x, y);//FindBitmap or something..
    end;

    procedure ShutDownPC;
    begin
      if ShutDown then // Set as a const.
      begin
        WriteLn('');
        WriteLn('Shutting down your PC.');
        WriteLn('To stop it once it starts counting, go to Start, Run, then type ''shutdown -a''');
        Wait(2000);
        KeyDown(92);
        Wait(200);
        KeyDown(82);
        Wait(200);
        KeyUp(82);
        Wait(200);
        KeyUp(92);
        Wait(2000);
        SendKeys('shutdown -s -f -t 60 -c "Shutting down PC '+TimeRunning+'"');
        Wait(2000);
        KeyDown(13);
        Wait(200);
        KeyUp(13);
        Wait(160000);
        TerminateScript;
      end;
    end;


    procedure DoClay;
    begin
      //procedures etc..
      if OutOfClay then
        ShutDownPC;
    end;

    begin
    SetupSRL;
    DoClay;
    end.

  11. #11
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    SCAR calls the ScriptTerminate procedure / function when you end a script or call the TerminateScript procedure. If you include it in your script, you can choose to call TerminateScript, which will then call ScriptTerminate, where you can put your shutdown code in. The other options listed above are usable also if you don't want this to run every time the script stops.

    Examples of shutdown codes have been posted above, so just put one of those in there if you want.
    :-)

  12. #12
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    It won't work in SMART. SMART.scar overrides KeyDown, KeyUp and SendKeys. All this will do is type 'shutdown -s -f -t 60 -c "Shutting down PC '+TimeRunning+'"' into your chat. Sorry.

  13. #13
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Is there a way to "unload" SMART Zeph? Like undefine it? Know what i mean?

  14. #14
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by itschris917 View Post
    Is there a way to "unload" SMART Zeph? Like undefine it? Know what i mean?
    Nope unless you restart the script. I've tried finding a way of getting shutdown to work for a while now... to no avail.

  15. #15
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmm, well i may have to make this my new aim

    i have tried learn to make scripts, but havent been able to. My new aim is to learn to make a smart shutdown procedure, it is probably harder, but at least it hasnt been done yet

  16. #16
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Butlerjones, can you read?

  17. #17
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes.... but i dont think you can

    i take it you are reffering to me saying it hasnt been done yet?

  18. #18
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah.. Look a few posts up..

  19. #19
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ZephyrsFury View Post
    Nope unless you restart the script. I've tried finding a way of getting shutdown to work for a while now... to no avail.
    there isnt a way with smart yet,

  20. #20
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by butlerjones View Post
    yes.... but i dont think you can

    i take it you are reffering to me saying it hasnt been done yet?
    OWNED CHRIS! LOL

    What keeps SCAR from calling an outside program that shuts down the PC?
    Active only during the Summer...

  21. #21
    Join Date
    Mar 2007
    Posts
    128
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hy71194 View Post
    Edit:
    Lol?? Where is that procedure? -.-
    Oh lol! My bad, I saw it in a script awhile back, and I didn't realize that it was a procedure. I thought it was built in.

    My bad .

  22. #22
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JackLKrawl View Post
    OWNED CHRIS! LOL

    What keeps SCAR from calling an outside program that shuts down the PC?
    He never referred to making one for SMART. He just said he was going to make one. Never specifying for SMART.

  23. #23
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well i thought it was obvious, seeing as i did say i wanted one that worked for SMART, but however, i apologize for not being as clear as i should have been.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multiplayer never finishes
    By spamthis in forum OSR Help
    Replies: 0
    Last Post: 09-14-2008, 12:55 AM
  2. Shutdown pc.
    By Johura in forum RS3 Outdated / Broken Scripts
    Replies: 18
    Last Post: 06-30-2008, 08:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •