Smartzkid
2008-06-10 22:51:05
ScriptTerminate:
A procedure that's automatically called when your script ends, even if the user clicks the Stop button.
Note that there are also ScriptPause and ScriptResume procedures that work the same way, these can also be useful in some situations.
Cases:
No longer will huge chains of If…Else haunt your scripts!
Well, I'd love to put more information in this tutorial, but I really can't come up with anything else. Feel free to drop me a PM if you know of a good addition to this tutorial, or if you need help with anything.
PS: Constructive criticism more than welcome!
Thanks to:
Wizzup - ScriptPause, ScriptResume
A procedure that's automatically called when your script ends, even if the user clicks the Stop button.
program New;
var
aBuffer: integer;
procedure ScriptTerminate;
begin
if(aBuffer <> 0)then
FreeBitmap(aBuffer);
writeln('Resources Freed.');
//ProgressReport;
end;
begin
aBuffer := CreateBitmap(100, 100, '');
//DoStuff;
end.Note that there are also ScriptPause and ScriptResume procedures that work the same way, these can also be useful in some situations.
Cases:
No longer will huge chains of If…Else haunt your scripts!
program New;
var
rand: integer;
begin
rand := random(10);
case rand of
0: //Walk to one place
1: //Walk to a second place
2: //Do antiban
3: //Idle for a few seconds
4: //Do antirandoms
5: //Find a bank
6, 7, 8: //Do nothing
9: //Give a jump for joy!
end;
end.Well, I'd love to put more information in this tutorial, but I really can't come up with anything else. Feel free to drop me a PM if you know of a good addition to this tutorial, or if you need help with anything.
PS: Constructive criticism more than welcome!
Thanks to:
Wizzup - ScriptPause, ScriptResume