SRL Archive - OSR Help

Looping problem


seikleja112

2011-02-25 04:24:47

Hello, im new to SCAR and scripting at all and im having trouble with looping a script.


program Clickbutton;

var
x, y: Integer;
procedure ClickColor;
begin
if FindColor(x,y, 12555099, 675, 377, 709, 389) then
begin
MoveMouseSmooth(692, 384);
Wait(100+random(200));
ClickMouse(692, 384, true);
end else
begin
end;
end;

begin
Wait(1000);
ClearDebug;
ClickColor;
end.

It says: Line 16: [Error] (16:1): Identifier expected in script
Please help!

And the button isnt always there, it might come up at any random time (even 10-20mins) , is this suitable for such thing?

Flight

2011-02-25 05:18:37

Change this:

begin
Wait(1000);
ClearDebug;
ClickColor;
end.
to this:
begin
ClearDebug;
repeat
ClickColor;
Wait(1000);
until(false)
end.

See, any code you put between "repeat" and "until" will repeat until you tell it to stop. What this modified code will do is click your color, wait 1 second (1000), and do it again, forever. The "Until(false)" you can change later on, but how I have it, it will loop forever. But careful when using this script, 1 second isn't very long and you might have a hard time clicking back on Simba/Scar to disable the script.

seikleja112

2011-02-25 05:52:06

Thanks alot script working great now.