
Originally Posted by
henryuscola
Thank you for your help is there a way i could make it search for the tree colors without the script stopping? like have it on a repeat loop until i manually stop the script
Yes.
Simba Code:
program YewCutter;
{$I SRL-6/SRL.simba}
Procedure ChopYew;
var
X,Y:Integer;
Begin
if mainscreen.findObject(x, y, 1717802, 21, ['Yew'], MOUSE_MOVE) Then
begin
wait(250);
ClickMouse(X, Y, mouse_left);
end
else writeln('tree not found'); // <- failsafe to prevent mouse clicking -1,-1 if tree not found.
end;
begin
MouseSpeed := 15;
repeat
ChopYew();
until false;
end.
This repeats searching tree untill you stop script.
or you might do it repeat untill it clicks tree:
Simba Code:
program YewCutter;
{$I SRL-6/SRL.simba}
function ChopYew(): boolean;
var
X,Y:Integer;
Begin
result:=false;
if mainscreen.findObject(x, y, 1717802, 21, ['Yew'], MOUSE_MOVE) Then
begin
wait(250);
ClickMouse(X, Y, mouse_left);
result:=true; // returns true if found and clicked on tree so loop can stop itself.
end
else writeln('tree not found'); // <- failsafe to prevent mouse clicking -1,-1 if tree not found.
end;
begin
MouseSpeed := 15;
repeat
wait(100); // waits few ms before trying again
until ChopYew();
end.