Is there a command to restart a script? I couldn't find anything in the manuals except terminate...
Thanks!
Is there a command to restart a script? I couldn't find anything in the manuals except terminate...
Thanks!
I am not sure about a command, but you could just do it using an extra loop outside of your main loop:
SCAR Code:repeat
repeat
Mine;
Bank;
Walk;
Whatever;
if(YouWantToRestart)then
break;
until(false);
until(false);
So just put an extra repeat until around your main loop. Whenever you want to restart, just call a break.
I'm looking for a way to restart the script during a procedure, such as:
If we are not where we want to be, restart script.
Else: Continue
Any ideas?
What you want is labels.
Example:
SCAR Code:program LabelExample;
var
I : Integer;
label
YourLabel; //Declare a label...I've called it YourLabel
begin
YourLabel: //Where to come back to...Put a colon (:) on the end, not a semi-colon (;)
I:= Random(10);
if (I <> 5) then
begin
WriteLn('Going back');
goto YourLabel; //This tells the script to go back to YourLabel (3 lines up)
end else
WriteLn('I = 5!'); //Puts 'I = 5!' in the debug box when I does = 5
end.
Here are two other tuts:
http://www.villavu.com/forum/showthr...ghlight=labels
http://www.villavu.com/forum/showthr...ghlight=labels
Richard.
<3
Originally Posted by Eminem
There are currently 1 users browsing this thread. (0 members and 1 guests)