SRL Archive - OSR Help

How do I make my Script Repeat itself


adamjasar

2012-07-18 23:45:59

Just decided I'd try learning something new before college


and here is my very first super simple script

[spoiler]
program new;
begin
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)

end.

[/spoiler]

How do i make is repeat itself without having to re-run the script?

Jordan155

2012-07-19 00:34:29

Just put it inside a loop?

shstiger2009

2012-07-19 00:37:49

procedure MainLoop;

begin
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
MoveMouse(211, 174)
ClickMouse(211, 174, 1)
Wait(2500)
end;

begin
repeat
MainLoop;
until (not (LoggedIn));
end.

Untested but, I think that works.

P1ng

2012-07-19 03:32:01

not LoggedIn is specific to runescape so that won't work.
program SimpleScript;
const
REPEATS = 1000; // How many times to repeat the script

procedure MainLoop;
var
i: Integer;
begin
MoveMouse(211, 174);
ClickMouse(211, 174, 1);
Wait(2500);
MoveMouse(211, 174);
ClickMouse(211, 174, 1);
Wait(2500);
MoveMouse(211, 174);
ClickMouse(211, 174, 1);
Wait(2500);
MoveMouse(211, 174);
ClickMouse(211, 174, 1);
Wait(2500);
MoveMouse(211, 174);
ClickMouse(211, 174, 1);
Wait(2500);
MoveMouse(211, 174);
ClickMouse(211, 174, 1);
Wait(2500);
Inc(i);
end;

begin
repeat
MainLoop;
until (i >= REPEATS);
end.

Footy

2012-07-19 08:03:51

Is this for runescape or another game? If runescape, use mouse(x, y, ranx, rany, button); It moves and clicks at once, and it moves at human speed.ranx and rany are randomness to the x and y coordinates, if you put 3 for each ran,it will click a random pixel between your x and y, and 3 pixels away, if that makes sence.

shstiger2009

2012-07-19 08:34:57

From: p1ng
not LoggedIn is specific to runescape so that won't work.


He never said it wasn't for Runescape, lol.

P1ng

2012-07-19 09:33:54

I just assume these things when I see no SRL include and the use of MoveMouse and ClickMouse.

But you are very correct, he did not state that it wasn't for RuneScape. In which case yours would work if you include SRL at the top.