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)));
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;
GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!
<BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols
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()
Last edited by KeepBotting; 02-24-2015 at 03:38 AM.
GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!
<BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols
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
There are currently 1 users browsing this thread. (0 members and 1 guests)