Something like this waits until the bank is open
but how would I add a timeout in pascal? ie If 3 seconds pass try the action again.Code:repeat
wait(randomRange(100, 250));
until(bankScreen.isOpen(GaussRangeInt(200, 350)));
Printable View
Something like this waits until the bank is open
but how would I add a timeout in pascal? ie If 3 seconds pass try the action again.Code:repeat
wait(randomRange(100, 250));
until(bankScreen.isOpen(GaussRangeInt(200, 350)));
.isOpen() takes a timeout paremeter itself, so you could dowhich will wait up to 10 seconds, and if you wanted to try again you could do...Simba Code:bankScreen.isOpen(10000)
Simba Code:procedure banking();
begin
//banking code here
if (not (bankScreen.isOpen(5000))) then
banking(); //try again
end;
Did I misinterpret your question? You want to repeat your banking action again if a timeout occurs, right? .isOpen() has a built-in timeout, so if that expires, repeat the procedure. If that's not what you need, let me know
e: if you mean in a global instance, not just the bankScreen you could use a TTimeMarker
Simba Code:procedure someProcedure();
var
t:TTimeMarker;
begin
//some code
t.start(); //start the TTimeMarker
repeat
doSomething();
wait(1000);
until (t.getTime() > 30000);
end;
That's just a generic timer which isn't tied to any specific function like .isOpen()
That's what I was looking for, I need to create something similar to the Time#sleepUntil(Condition condition) function in another client.
Thank you :)
a purpose:
Simba Code:if (not isBurning) then
begin
findBonFire();
globalTimer.start;
repeat
wait(randomRange(100, 250));
until(isBurning or globalTimer.getTime() > 3000);
globalTimer.reset;
end;
excuse my poor pascal abilities