Log in

View Full Version : Terminate Script bug?



gerauchert
06-20-2007, 01:37 AM
ok so im adding my tree finding failsafe to my powerchopper and i want it to terminate the script when it doesnt find the tree....

so when it doesnt find the tree it terminates the script fine....BUT after its terminated....the mouse FREAKS OUT and starts moving back and forth really fast (kinda vibrating like) and i have to restart my compy for it to go back to normal.

is this normal cuz this happens every time for me?

if it is...then is there another command to end the script?

thanks

tim46
06-20-2007, 01:42 AM
Can you post the procedure/function where you terminate the script? And the main loop if thats possible.

gerauchert
06-20-2007, 01:48 AM
ok here it is....

//TREE FINDER//
procedure FindTheTree;

var Tries: Integer;
begin
if(not(LoggedIn))then
Exit;
begin
repeat
Wait(1000 + random(250));
Tries:= Tries + 1;
if(Tries = 20)then
begin
Writeln('couldnt find color...ending script');
TerminateScript;
end;
until(FindColorTolerance(x,y,TreeColor,MSX1,MSY1,M SX2,MSY2,3));
end;
end;


//MAIN LOOP//
begin
ScriptSetup;
if (not(LoggedIn)) then
LogInPlayer;
Setup;
NEWLINE:='';
DeclarePlayers;
Randoms;
repeat
if (not(LoggedIn)) then
LogInPlayer;
Chop;
Drop;
Proggy;
Randoms;
DontGetBanned;
until Loads >= Players[CurrentPlayer].Loads1
if Loads >= Players[CurrentPlayer].Loads1 then
Logout;
NextPlayer(True);
end.

Mjordan
06-20-2007, 01:53 AM
I'm not 100% sure this is it, but I can pretty much say that I know what the problem is.

After your TerminateScript you shouldn't have until(FindColorTolerance(x,y,TreeColor,MSX1,MSY1,M SX2,MSY2,3));

There is no need to have that since the script is already ended.

And you might not want to terminate the script if you plan on making it multiplayer. You should probably use a Break;or Exit; then NextPlayer(False) so the script will continue autoing with the next player ;)

gerauchert
06-20-2007, 02:03 AM
ok thanks,

yea just converted to multi =p ill change that

:stirthepot:

Bobarkinator
06-20-2007, 02:17 AM
you can keep that until because it only terminates the script if tries is at 20 so you still want the until to search those 20 times then terminate.

gerauchert
06-20-2007, 02:29 AM
yep i left the until but changed the terminate script to just Exit; b/c i have it on multiplayer now w00t :spot:

thanks for your help guys :p