that a really good start here a few fail safes that could help
in your banking method
Code:
procedure openBank;
begin
bankScreen.open(BANK_NPC_GREY);
wait(gaussRangeInt(1000, 2000));
end;
we want to make sure that it one its logged in and two that we actualy find and click the banker so something like this could be usefull
Code:
procedure openBank;
begin
if not isLoggedIn() then
exit;
repeat
bankScreen.open(BANK_NPC_GREY);
wait(gaussRangeInt(1000, 2000));
Until bankScreen.isOpen()
end;
is not logged in is a good fail safe to have when making loops that way it will exit if you are not logged in. then in the same manor we want to make sure that the bank is actually open before sending our hot key that way were not randomly pressing one
Code:
procedure bankPreset;
begin
if bankScreen.isOpen(1000) then
begin
repeat
bankScreen.clickButton(BANK_BUTTON_PRESET_2, false);
wait(gaussRangeInt(1000, 2000));
until (not Bankscreen.isOpen) or (not isLoggedIn());
end;
end;
again this checks that the bank is open before we send our key. for your setup you could include something like this
Code:
procedure setUp;
begin
clearDebug();
setupSRL();
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
this just makes the bot make sure that angle is high and map facing north as a fail safe. finally we can improve the logic of the main loop so that the script can be started in any situation.
Code:
begin
setUp;
if tabBackpack.isFull() then
castSuperGlassMake()
else if bank.isOpen() then
bankPreset()
else
for loopCount := 1 to 1000 do
begin
mainLoop();
if (random(100) < 10) then
begin
wait(gaussRangeInt(5000, 10000));
end;
end
end.
this just makes the bot check on start up that the bank is not open or that the inventory is not full its those little bits of logic that can help make a good script be great and stable