SRL Archive - Help

until(false); ????


spin3x

2012-12-19 10:24:09

This is a simple anti-ban which I tried creating, its really simple and so far it seems to work.

   program Theiving;

var
time: integer;

Procedure StartTheiving;
var
x, y:Integer;
begin
if FindColorSpiralTolerance(x, y, 16711680, 0, 340, 515, 470, 5) then
MoveMouse(755, 9); //Don't use Move Mouse (see below)
wait(5000);
ClickMouse(755, 9, 1)
begin
if FindColorSpiralTolerance(x, y, 1777019, 555, 337, 712, 434, 5) then
MoveMouse(631, 402); //Don't use Move Mouse (see below)
wait(5000);
ClickMouse(631, 402, 1)
end;
end;



begin
repeat
StartTheiving;
until(false);
end.

It basically looks to see if there's text in the chat box, if yes then logs out. I would like it to stop if it found text and logged out for me. How would I set the until(false); so it stops once its logged out.

Thank you.

DannyRS

2012-12-19 10:25:56

Until(Not LoggedIn)

Edit - requires using the SRL include

Google

2012-12-19 10:26:59


logout;
terminatescript(); //after logout.

Wardancer

2012-12-19 10:57:35

I believe I can see what you're trying to do with your thieving function. Let me help (even if that's unrelated to your post):

program Theiving;

var
time: integer;

Procedure StartTheiving;
var
x, y:Integer;
begin
if FindColorSpiralTolerance(x, y, 16711680, 0, 340, 515, 470, 5) then
begin //Need a begin and end there else only the first line after an if..then will be triggered and the next ones will go in action whether you found the thing or not.
MoveMouse(755, 9); //Don't use Move Mouse (see below)
wait(5000);
ClickMouse(755, 9, 1);
end;
if FindColorSpiralTolerance(x, y, 1777019, 555, 337, 712, 434, 5) then
begin
MoveMouse(631, 402); //Don't use Move Mouse (see below)
wait(5000);
ClickMouse(631, 402, 1);
end;
end;



begin
repeat
StartTheiving;
until(allPlayersInactive); //I personally prefer this one in case you want to add more than one player to the script.
end.

EDIT: Also, I strongly suggest you NOT to use MoveMouse or Clickmouse. Instead, use MMouse and Clickmouse2.

spin3x

2012-12-19 11:30:08

Thanks for all the replies, I'll try them in a second.

@Ward, I forgot to mention this is on a RSPS, so it doesn't really matter.

EDIT - For some reason when I add SRL, the method seems to stop working :S any idea's why that's happening? The script stops if there's text in the chat, but it doesn't actually do anything ingame. If I take the SRL out and make it until(false); then it works.

Wardancer

2012-12-19 17:02:28

I'm not sure I understand what goes wrong. Is it just the loop (repeat.. until)? If so, you'll probably be better off with a custom condition for your rsps script, either an impossible to reach one or something related to time for example. Only your imagination is the limit of how you can end this loop.