SRL Archive - Help

Is SRL outdated?


KeepBotting

2012-09-26 19:53:36

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

2012-09-26 19:57:34

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

2012-09-26 19:58:48

From: Le Jingle
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

2012-09-26 20:00:44

Post your code? you probably forgot something like SetupSRL or you didn't put your proc/func in your mainloop.

KeepBotting

2012-09-26 20:02:12

From: Nebula
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

2012-09-26 20:03:04

Dude.
What is with the standards.
D:

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

KeepBotting

2012-09-26 20:03:43

From: NKN
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

From: NKN
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.