Hey, i got a RSPS <zulrah> script i have been working on. but got some problems (im new to simba scripting). The problem is that it just repeat the pray switches over and over again, so it turns off/on the pray like 10 times on every zulrah face. i have no idea how i can loop it so that it will wait for zulrah to switch face before it repeats. Thanks

program Simbabot;

procedure zulrahstart;
begin
MoveMouse(928, 104);
ClickMouse(928, 104, 1);
wait(400);
MoveMouse(733, 179);
wait(400);
ClickMouse(733, 179, 1);
wait(400);
MoveMouse(563, 119);
wait(400);
ClickMouse(563, 119, 1);
wait(400);
MoveMouse(583, 261);
wait(400);
ClickMouse(583, 261, 1);
wait(200);
MoveMouse(747, 213);
wait(400);
ClickMouse(747, 213,1);
wait(400);
MoveMouse(666,283);
wait(400);
ClickMouse(666, 283, 1);
wait(400);
MoveMouse(80, 167);
wait(1000);
ClickMouse(80, 167, 1);
wait(400);
MoveMouse(232, 239);
wait(1000);
ClickMouse(232, 239, 1);
wait(5000);
end;

procedure KillZulrahRange;
var
i, x, y:Integer;
begin
if FindColor(x, y, 1625528 , 12, 34, 516, 364) then
begin
MoveMouse(x, y);
wait(400);
ClickMouse(x, y, 1);
MoveMouse(713, 215);
wait(400);
ClickMouse(713, 215, 1);
wait(1000);
MoveMouse(647, 363);
wait(400);
ClickMouse(647, 363, 1);
end else
if FindColor(x, y, 1595588 , 12, 34, 516, 364) then
begin
MoveMouse(713, 215);
wait(400);
ClickMouse(713,215, 1);
wait(400);
MoveMouse(682, 364);
wait(1000);
ClickMouse(682, 364, 1);
wait(1000);
MoveMouse(x, y);
wait(400);
GetMousePos(x, y);
wait(400);
ClickMouse(x, y, 1);
end else
if FindColor(x, y, 11935608 , 12, 34, 516, 364) then
MoveMouse(713, 215);
wait(400);
ClickMouse(713,215, 1);
wait(400);
MoveMouse(608, 365);
wait(400);
ClickMouse(608, 365, 1);
End;



begin
ActivateClient;
Zulrahstart;
repeat
Killzulrahrange;
until (false)
end.