SRL Archive - OSR Help

banking failsafe help


Le Jingle

2012-04-15 00:50:29

Hey, I'm wondering if I can use this little bit I wrote up (not necessarily my idea's, seeing as most comes from the includes #creds2srlTeam). I use it in a script, but I'm curious if it's a potential for causing problems (i.e. bad form/misuse of statements, etc.)

Ideally it's suppose to see if you are not viewing your bankscreen, then if so, will search for the bank on the mini map to relocate to the aforementioned bank.


procedure DaBank;
var
z: Integer;
begin
BankChest;
if (BankScreen) then
begin
// Bank stuffs
Exit;
end else

if not (BankScreen) then
FindNormalRandoms();
begin
if FindBank('SRL_BANK_CW') then
BankChest;
if not (BankScreen) then
repeat
FindBank('SRL_BANK_CW');
incEx(z, 1);
until(BankScreen);
if z=5 then
begin
Writeln('Error, out of range.');
Logout;
TerminateScript;
end;
end;
end;

Total

2012-04-15 01:15:00

You could put FindBank and a Wait in a repeat with an until didredclick, but I don't like using until didredclick because it only works half the time for me for some reason(probably color changes). Heres another idea using a for to do loop.


procedure DaBank;
var
i : Integer;
begin
for i := 0 to 2 do
begin
if FindBank('SRL_BANK_CW') then
if BankScreen then
begin
BankChest;
Break;
end else
Writeln('Bank not opened, trying again');
end;
if i = 2 then
Writeln('Couldnt open bank');
Logout;
TerminateScript;
end;

I'm not too familiar with the FindBank procedure but if you need to, add waits wherever needed.

Gucci

2012-04-15 01:18:30

Doesn't look like the code will look for the bank symbol on minimap for that you need something like.

If FindSymbol(x, y, 'bank') then
Begin
ClickMouse2(True);
End;

TotalKillz that if BankScreen then should be after BankChest; that way it'll open Bank with BankChest then look for BankScreen and do the banking required

Total

2012-04-15 01:22:15

Oh lol. I thought it was a failsafe for not opening the bank screen xD. Yeah I think FindBank is to open the bank, will have to use FindSymbol or something else to get to the bank.

Le Jingle

2012-04-15 01:25:56

ah okay, I've only tested the find bank whilst the bank is still on screen, and it worked. I'll try the find symbol suggestion from you two, thanks.