SRL Archive - OSR Help

How do I tell Simba to repeat something until it's found


rsbots2013

2013-05-16 03:41:04

Basically how do I tell Simba to FindColorSpiralTolerance and repeat until it finds that color then allow me to use the color.

How I do it now

if FindColorSpiralTolerance(x,x,x,x,x,x,x,x) then
writeLn('found the color')
MoveMouse (x,x)

Sjoe

2013-05-16 04:17:30

Could use a "break" when you've found the colour.


procedure IttyWitty;
var
x, y, Failsafe: Integer;

begin
Failsafe := 0; // Resetting it to zero

repeat
if FindColorSpiralTolerance(x, y, 24352, MSX1, MSY1, MSX2, MSY2, 5) then
begin
Writeln('Found The Color');
MMouse(x, y, 1, 1, True);
Break; // Breaks out of the loop and continues with the script.
end else Failsafe := Failsafe +1 ;
if Failsafe >= 10 then Break; // For not getting stuck in an inf. loop we add a failsafe.
Wait(100); // To prevent lag we add a small wait.
until(false)
end;

rsbots2013

2013-05-16 04:20:04

thank you