Log in

View Full Version : Is SRL outdated?



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;

Le Jingle
09-26-2012, 11:57 PM
FindObj generally isn't my favorite favorite function, creating personal / owns functions can be much better. As for FindColorSpiralTolerance, try adjusting your tolerance by increasing it / picking a more accurate color to start searching for.

KeepBotting
09-26-2012, 11:58 PM
FindObj generally isn't my favorite favorite function, creating personal / owns functions can be much better. As for FindColorSpiralTolerance, try adjusting your tolerance by increasing it / picking a more accurate color to start searching for.
No, I mean it doesn't work. Doesn't do anything, doesn't move the cursor or execute any code. It worked fine yesterday.

Nebula
09-27-2012, 12:00 AM
Post your code? you probably forgot something like SetupSRL or you didn't put your proc/func in your mainloop.

KeepBotting
09-27-2012, 12:02 AM
Post your code? you probably forgot something like SetupSRL or you didn't put your proc/func in your mainloop.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;

NKN
09-27-2012, 12:03 AM
Dude.
What is with the standards.
D:

Edit: You check for uptext, without moving the mouse first?

KeepBotting
09-27-2012, 12:03 AM
Dude.
What is with the standards.
D:Those are my standards. That's how I read and write code.
Dunno why, but reading indented stuff hurts my eyes.

No one ever bothered to teach me standards XD


Dude.
Edit: You check for uptext, without moving the mouse first?Hmm.
That seems illogical yeah. But it worked perfectly yesterday.

And besides, it doesn't do anything.