SRL Archive - OSR Help

Running a function when the script dies


xdarkshadowx

2013-01-04 03:00:31

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 :)

NKN

2013-01-04 03:05:16

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

riwu

2013-01-04 03:06:57

From: xdarkshadowx
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.

xdarkshadowx

2013-01-04 03:07:38

From: NKN
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!