cynicz
2013-11-10 12:12:18
Ok, I am making a bot for a game, I have everything made but I want to add a couple failsafes if possible.
Is there a way to make a script restart the mainloop if its stuck for more than say like 30 seconds.
Basically I have it click the button to change worlds untill it sees a DTM matching the world I need to be in. sometimes it gets stuck on this and it shouldnt take more than like 15 seconds to find the world. Can I make it where if the script is stuck in any loop for more than XX seconds it restarts script.
also I have it repeat mainloop until F3 is pressed. However when F3 is pressed it finishes the whole mainloop before stopping, is there anyway to make it stop as soon as you press f3 no matter where the script is at in the coding?
Heres my repeat until loop
Is there a way to make a script restart the mainloop if its stuck for more than say like 30 seconds.
Basically I have it click the button to change worlds untill it sees a DTM matching the world I need to be in. sometimes it gets stuck on this and it shouldnt take more than like 15 seconds to find the world. Can I make it where if the script is stuck in any loop for more than XX seconds it restarts script.
also I have it repeat mainloop until F3 is pressed. However when F3 is pressed it finishes the whole mainloop before stopping, is there anyway to make it stop as soon as you press f3 no matter where the script is at in the coding?
Heres my repeat until loop
Begin
time:=GetSystemTime;
StartWorld;
ClickCity;
Repeat
MainLoop;
if(GetSystemTime-time>28800000) then //8 hrs
StartWorld;
ClickCity;
until (IsKeyDown(114));
End.