SRL Archive - SRL Suggestions

WaitBankScreen function


Fwd Motion

2012-02-09 11:15:09

I noticed this wasn't an option and I was getting tired of the specific sleep times for the bank, so created this to wait for the bankscreen to pop up. (:

(*
WaitBankScreen
~~~~~~~~~~~~~~~

.. code-block:: pascal

function WaitBankScreen(Time:integer): Boolean;

Waits for BankScreen, returns true if found

.. note::

by Fwd Motion!

Example:

.. code-block:: pascal

if (WaitBankScreen(1000)) then
QuickDeposit(SRL_DEPOSIT_ALL)

*)

function WaitBankScreen(Time:integer): Boolean;
var
T: Integer;
begin
Result := false;
T := GetSystemTime + Time;
while (GetSystemTime < T) do
begin
if (BankScreen) then
begin
Result := True;
Exit;
end;
Wait(20+Random(20));
end;
end;

Smidqe

2012-02-09 11:30:11

You could just use
WaitFunc(@Bankscreen, 150, 5000);

What it does, it'll search for bankscreen every 150 milliseconds, for 5 seconds. You can change the values to anything you want.

Fwd Motion

2012-02-09 11:45:44

Yeah, but this makes it a ton easier, and its easier to read.

I mean we have waituptext, waitinvcount, why not waitbankscreen?

Coh3n

2012-02-09 19:29:17

From: Fwd Motion
Yeah, but this makes it a ton easier, and its easier to read.

I mean we have waituptext, waitinvcount, why not waitbankscreen?
Because you can just use WaitFunc(@Bankscreen, 150, 5000);, you can't do that with the uptext/option functions. Well actually, you can now (with WaitFuncEx), but you didn't used to be able to.

All the Wait* functions may be merged with the regular functions in future versions of SRL anyway.

Fwd Motion

2012-02-09 19:39:14

From: Coh3n
Because you can just use WaitFunc(@Bankscreen, 150, 5000);, you can't do that with the uptext/option functions. Well actually, you can now (with WaitFuncEx), but you didn't used to be able to.

All the Wait* functions may be merged with the regular functions in future versions of SRL anyway.


Well I was unaware of how WaitFunc worked, but now that I know I'll use that instead, thanks!

Also, I like the customizable wait time between searches.

Thanks Smidqe and Coh3n for expanding my knowledge! (: