Results 1 to 4 of 4

Thread: Running a function when the script dies

  1. #1
    Join Date
    Feb 2012
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default Running a function when the script dies

    So I know you can use AddonTerminate('procedure'); to have a procedure run when you stop simba, but I Want this procedure to run when simba blows up while I'm away from the computer, not when I'm at the computer to click the stop button. Let me know if this is possible :s
    Thanks
    Non-RS scripter, if you need a hand with scripting let me know. I have a decent amount of experience scripting for non-RS games.

    How to add text messaging to any script: http://villavu.com/forum/showthread....98#post1151998

  2. #2
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    AddOnTerminate runs it whenever the script shuts down, if you click the stop button or use TerminateScript, it doesn't matter.

    If you mean a runtime error that stops the script, you can't do that then.

    Edit: I lied, surround EVERYTHING with Try/Except

  3. #3
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by xdarkshadowx View Post
    So I know you can use AddonTerminate('procedure'); to have a procedure run when you stop simba, but I Want this procedure to run when simba blows up while I'm away from the computer, not when I'm at the computer to click the stop button. Let me know if this is possible :s
    Thanks
    'When Simba blows up'?
    AddonTerminate activates both when the script finishes/when you interrupt it manually.

  4. #4
    Join Date
    Feb 2012
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    AddOnTerminate runs it whenever the script shuts down, if you click the stop button or use TerminateScript, it doesn't matter.

    If you mean a runtime error that stops the script, you can't do that then.

    Edit: I lied, surround EVERYTHING with Try/Except
    Thanks, I don't really ever have runtime errors so I guess this isn't too bad news, just thought it woulda been cool to cover all possible mess-ups. Thanks anyways!
    Non-RS scripter, if you need a hand with scripting let me know. I have a decent amount of experience scripting for non-RS games.

    How to add text messaging to any script: http://villavu.com/forum/showthread....98#post1151998

Thread Information

Users Browsing this Thread

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

Posting Permissions

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