View Full Version : Terminating and restarting a script.
Is it possible to terminate a simba script, then immediately run it again? I simply want my script to start over from the top of a repeat loop in the mainloop.
This procedure is not in the mainloop and is only called as a backup in other procedures. After I peform this backup procedure, is it possible to do something like restartrepeatloop; or something :S
YoHoJo
07-14-2012, 11:57 PM
http://villavu.com/forum/showthread.php?t=76404&highlight=smart+manager
Enter
07-15-2012, 12:23 AM
http://villavu.com/forum/showthread.php?t=76404&highlight=smart+manager
I use the Smart Manager, but sometimes when it restarts simba and opens the client after 6 hours. I wake up to find the script not running? I thought Smart Manager restarted everything and restarted the script too. I tried failsafe, restart compile and force restart and none of them fix the problem. Also I heard there was a problem with smart recently because of Slayer update, is it fixed?
Runaway
07-15-2012, 12:31 AM
Is it possible to terminate a simba script, then immediately run it again? I simply want my script to start over from the top of a repeat loop in the mainloop.
This procedure is not in the mainloop and is only called as a backup in other procedures. After I peform this backup procedure, is it possible to do something like restartrepeatloop; or something :S
Jah. Just put it inside a repeat loop!
repeat
repeat
MainLoop;
if Failsafe then
Break;
until(Whatever);
FailsafeLoop;
until(Whatever);
Something kinda like that.
I use the Smart Manager, but sometimes when it restarts simba and opens the client after 6 hours. I wake up to find the script not running? I thought Smart Manager restarted everything and restarted the script too. I tried failsafe, restart compile and force restart and none of them fix the problem. Also I heard there was a problem with smart recently because of Slayer update, is it fixed?
The update still has smart broken
Also, sometimes I have this issue because of the FPS error that was occuring in smart where it would take a long time to load the game and the script would time out after waiting for up to 3mins for it to load
putonajonny
07-15-2012, 12:45 AM
Using Continue makes it start from the begining of the loop:
Repeat
//Do some stuff
if(SomethingIsTrue)then //If that something is true it goes back to before "Do some stuff"
Continue;
//Do other stuff
Until(false);
Enter
07-15-2012, 05:49 AM
I had the problem BEFORE the slayer update though, maybe the script didn't have the repeat until part? Anyway, can you just load up rs from the site and make the script rn on that? The only bad thing would be it doesn't restart after 24/hrs, but that's better than nothing right?
Using Continue makes it start from the begining of the loop:
Repeat
//Do some stuff
if(SomethingIsTrue)then //If that something is true it goes back to before "Do some stuff"
Continue;
//Do other stuff
Until(false);
so like if it was this,
Repeat
stuff;
stuffff;
stiffffffff;
stufffffffffffffff;
morestuff;
mheapsmorestuff;
if(SomethingIsTrue)then //If that something is true it goes back to before "Do some stuff"
Continue;
//Do other stuff
Until(false);
and there was a lot of procedures sandwiched in between, would it detect "somethingistrue" anywhere and everywhere no matter where it is in the repeat loop right?
if not is there a way to?
It will check for the boolean (SomethingIsTrue) at the place that u call it.
Eg.
Action1;
if SomethingIstrue then
Continue;
Action2;
Its going to perform Action1, then checks for SomethingIsTrue, then if thats false it will continue to Action2. If u want it to check at several places then u have to call it in between every procedure.
putonajonny
07-15-2012, 09:22 AM
so like if it was this,
Repeat
stuff;
stuffff;
stiffffffff;
stufffffffffffffff;
morestuff;
mheapsmorestuff;
if(SomethingIsTrue)then //If that something is true it goes back to before "Do some stuff"
Continue;
//Do other stuff
Until(false);
and there was a lot of procedures sandwiched in between, would it detect "somethingistrue" anywhere and everywhere no matter where it is in the repeat loop right?
if not is there a way to?
Yes that's fine, it wouldn't matter how many functions / procedures it has to "jump past" it will always go to the beginning of the Repeat loop
It also works with while and for loops:
for i := 1 to 5 do
begin
if(i = 3)then
Continue;
WriteLn(i);
end;
Would output:
1
2
4
5
This is because when i = 3 it jumps to the next iteration of the loop
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.