Lets just start off by including the code:
It's heavily under construction and any ideas to make it simpler are welcome but I'm pretty sure the problem is that my Attempts := 0; in between loops won't reset the variable.PHP Code:procedure Bank;
var
Banking, Attempts, Items: integer;
begin
MarkTime(Banking);
Attempts := 0;
if not BankScreen then
begin
repeat
inc(Attempts);
Writeln('Attempting to open bank... Attempt: ' + IntToStr(Attempts) + '...');
OpenBankChestEdge(SRL_BANK_SW);
Wait(randomRange(900, 1000));
until ((BankScreen) or (Attempts>=3) or (TimeFromMark(Banking)>6000))
end else
if not (BankScreen) and (Attempts>=3) then
begin
Writeln('Failed opening bank after ' + IntToStr(Attempts) + 'attempts... Closing...');
LogOut;
TerminateScript;
end else
// Set attempts back to 0 for depositing
Attempts := 0;
if (InvCount>1) or (InvFull) then
begin
repeat
Inc(Attempts);
Writeln('Depositing items... Attempt: ' + IntToStr(Attempts) + '...');
Deposit(2, 28, False);
Wait(randomRange(900, 1000));
until ((InvCount<=1) or (Attempts>=3) or (TimeFromMark(Banking)>12000))
if (InvCount=0) or (Attempts>=3) then
Writeln('Failed depositing items after ' + IntToStr(Attempts) + ' attempts (runes might have ran out/are missing)... Closing...');
LogOut;
TerminateScript;
end else
// Set attempts back to 0 for withdrawing
Attempts := 0;
CheckTarget;
if (GetBankItemAmount(0, 9)>=27) then
begin
repeat
Inc(Attempts);
Items := (GetBankItemAmount(0, 9));
Writeln(IntToStr(Items) + ' rings left... Last load... Attempt: ' + IntToStr(Items) + '.');
Withdraw(0 ,9, Items);
Wait(randomRange(900, 1000));
until ((InvCount=Items) or (Attempts>=3) or (TimeFromMark(Banking)>20000))
end else
repeat
Inc(Attempts);
Writeln('Withdrawing items... Attempt: ' + IntToStr(Attempts) + '...');
Withdraw(0, 9, 27);
Wait(randomRange(900, 1000));
until ((InvCount=28) or (Attempts>=3) or (TimeFromMark(Banking)>20000))
end;
This is why I suspect this:
As you see my repeats go until attempts>=3 so it just stops.PHP Code:Attempting to open bank... Attempt: 1...
Depositing items... Attempt: 2...
Successfully executed.
It should correctly say Depositing items... Attempt: 1... obviously since it's the first attempt duh.
Any help?


Reply With Quote



