KeepBotting
09-26-2012, 11:53 PM
Stuff like FindObj and FindColorSpiralTolerance won't work for me, it just sits and does nothing.
My procedure:
procedure ChallengeSlave;
var x,y:integer;
begin
ScriptStatus:= 'Challenging the Slave to a friendly duel';
ProgressReport;
WriteLn('We are trying to find the Slave.');
if FindColorSpiralTolerance(x, y, SLAVE_COLOR, MSX1, MSY1, MSX2, MSY2, 10) and IsUpText(SLAVE_USERNAME) then //Check for the Slave's color and if found, makes sure the correct UpText also exists.
WriteLn('Detected correct colors and UpText.');
begin
Mouse(x, y, 0, 0, mouse_Right);
ChooseOption('hallenge');
if DidRedClick then //To make sure we actually clicked Challenge.
begin
wait(500+random(500)); //Waits a bit for the interface to show up.
MouseBox(202, 196, 317, 210, mouse_Left); //Will be replaced with a WaitUpText.
end
else
begin
WriteLn('We failed to find the Slave, retrying in 1sec...');
wait(1000);
ChallengeSlave;
end;
end;
end;
My procedure:
procedure ChallengeSlave;
var x,y:integer;
begin
ScriptStatus:= 'Challenging the Slave to a friendly duel';
ProgressReport;
WriteLn('We are trying to find the Slave.');
if FindColorSpiralTolerance(x, y, SLAVE_COLOR, MSX1, MSY1, MSX2, MSY2, 10) and IsUpText(SLAVE_USERNAME) then //Check for the Slave's color and if found, makes sure the correct UpText also exists.
WriteLn('Detected correct colors and UpText.');
begin
Mouse(x, y, 0, 0, mouse_Right);
ChooseOption('hallenge');
if DidRedClick then //To make sure we actually clicked Challenge.
begin
wait(500+random(500)); //Waits a bit for the interface to show up.
MouseBox(202, 196, 317, 210, mouse_Left); //Will be replaced with a WaitUpText.
end
else
begin
WriteLn('We failed to find the Slave, retrying in 1sec...');
wait(1000);
ChallengeSlave;
end;
end;
end;