From: lovebotter
Another problem:
function banking(preset: integer): boolean;
var
button: integer;
backpackResult: boolean;
begin
if not isLoggedIn then
exit;
timer.start;
if preset = 1 then
begin
backpackResult := tabBackpack.isEmpty;
button := BANK_BUTTON_PRESET_1;
end;
if preset = 2 then
begin
backpackResult := tabBackpack.isItemInSlot(1);
button := BANK_BUTTON_PRESET_2;
end;
begin
repeat
if bankscreen.open(14) then
break
else
setCamera;
if (timer.getTime > timeOut) or (not isLoggedIn) then
exit;
until (bankScreen.isOpen or pinscreen.isOpen);
pinScreen.Enter(players[currentPlayer].bankPin);
repeat
wait(gaussRangeInt(100, 500));
if bankScreen.clickButton(button) then
break;
if (timer.getTime > timeOut) or (not isLoggedIn) then
exit;
until (not bankScreen.isOpen);
end;
repeat
wait(gaussRangeInt(100, 500));
if (backpackResult) then
begin
writeln('backpackResult true');
break;
end;
if (timer.getTime > timeOut) then
begin
writeln('Failed withdrawing, shutting down');
players[currentPlayer].logout;
terminateScript;
end;
if not isLoggedIn then
exit;
until (false);
if (backpackResult) then
result := true;
end;
The backpackResult boolean doesn't seem to work? It never returns true so the script times out.
writeLn it out whenever you set it, i.e.
{ . . . }
if preset = 1 then
begin
backpackResult := tabBackpack.isEmpty;
button := BANK_BUTTON_PRESET_1;
writeLn('backpackResult returns ' + lowercase(toStr(backpackResult)));
end;
{ . . . }
if preset = 2 then
begin
backpackResult := tabBackpack.isItemInSlot(1);
button := BANK_BUTTON_PRESET_2;
writeLn('backpackResult returns ' + lowercase(toStr(backpackResult)))
end;
This way, you can see exactly what is returning which values, and when