Simba Code:
procedure Bank();
var
x, y: Integer;
timer: TTimeMarker;
begin
timer.start();
repeat
if (not isLoggedin()) then
break;
if mainScreen.findObject(x, y, 8143188, 14, colorSetting(2, 0.38, 0.69), mainscreen.getCenterPoint(), 10, 50, 1, ['ank'], MOUSE_LEFT) or bankScreen.isOpen() then
if bankScreen.isOpen(random(3000, 5000)) then // Wait for 3-5 sec for bank to open
begin
writeLn('Yay, bank is open, let''s deposit stuff');
Wait(500 + random(400)); // recommended to wait a bit before pressing the button, otherwise it might mess up and or get banned.
//I always put this in a loop with many failsafes just to make sure it does manage to press the preset, e.g. lag won't mess it up.
if bankScreen.clickButton(BANK_BUTTON_PRESET_1) then
break; // Break out if clickButton returns true (it returns true if bank is closed)
end;
until (timer.getTime() > 30000); // Stop trying after 30 seconds
writeLn('Failed to bank within 30 seconds');
end;
This should work (notice the or condition to the right) given that the colors are right. It's a bit unnecessary to check if bank's open twice but it shouldn't matter though. I mean you could use a goto but thats just going to be confusing for you.