Simba Code:
program Prophit;
const
maxWait = 20000;//20 seconds
var
x, y, aTime, bTime: Integer
begin
{old
if (FindColor(x, y,211426,60,72,1128,690) and (x>150)) then
begin
Movemouse(x, y);
sleep(2000); //why are you waiting here for 2 seconds is there anything else you could do to tell if your ready for the next click
clickmouse(x,y,1);
clickmouse(x,y,1);
}
//new
aTime := GetTickCount;
while not FindColor(x, y,211426,60,72,1128,690) and (x>150) do //this will be your method of choice for detecting if your ready to move on
begin
wait(100);
bTime := GetTickCount;
if bTime - aTime > MaxWait then TerminateScript;
//infinite loops require failsafes incorporate one here for example use GetTickCount and check if a certain time has passed
end;
Movemouse(x, y);
clickmouse(x,y,1);
clickmouse(x,y,1);
//end
Writeln(x);
Writeln(y);
sleep(1000); //again why are you sleeping is there anything else tobe done her instead
PressKey(113); //is it possible to check if this event worked?
Movemouse(x, y);
sleep(2000); //again sleep causes hangs while using wait simba will still process event messages
Writeln(x);
Writeln(y);
sleep(1000); //again
ShowMessage ('Press YES when prompted to install Drivers. PRESS OK OR ENTER NOW TO CONTINUE');
sleep(2000); //again
{old
FindColor(x, y,32768,60,72,1128,690);//this line of code is doing nothing with the infomation your asking it simply asks if the color is there and clicks regardless
Movemouse(x,y);
Clickmouse(x,y,1);
Clickmouse(x,y,1);
}
//new
if FindColor(x, y,32768,60,72,1128,690) then
begin
Movemouse(x,y);
Clickmouse(x,y,1);
Clickmouse(x,y,1);
end else //dont rely on just one check have a failsafe a plan B so for example if not FindColor(x,y,RGB,x1,y1,x2,y2) then FindColor(x,y,RGB2,x1,y1,x2,y2;
//end
end else
ShowMessage('Could not find icons');
end.
juts a couple of tips for you to think about keep it up