Hi so im still quite new to scripting but I am looking to make a safeguard in my script to make sure it doesn't skip until the action is complete.
I made one safeguard for talking to my npc
procedure clicknpc();
var
x, y, i: integer;
begin
if not isLoggedIn() then
exit;
repeat
mainscreen.findObject(x, y, 3163475, 18, colorSetting(2, 0.05, 0.32), mainscreen.playerPoint, 8, 25, 20, ['npc'], MOUSE_LEFT);
wait(randomRange(1000, 2000));
inc(i);
until conversationBox.isOpen();
end;
but I am wondering if I can do it for other actions... specifically making sure that I find the door and actually open the door before continuing.
procedure clickDoor();
var
x, y: integer;
repeat
if mainscreen.findObject(x, y, 407630, 5, ['oor'], MOUSE_RIGHT) then
begin
writeLn('We right clicked the door!');
chooseOption.select(['pen']);
until
(This is the part where I am having trouble)
end;
end;
What I am wanting is to write a script saying repeat trying to find and click door until ... you have clicked the object. I'm not sure if I am making sense in my question. Thanks!