This function, it works for normal banks. for bankchests it seems not to. Why, I have no idea, as its the same function in both scenarios...
This loop only executes once on bank chests...
Simba Code:
DebugStr(3,'Waiting for bank and pin screens...');
MarkTime(T);
while (not BankScreen) and (not PinScreen) and (TimeFromMark(T) < RandomRange(5000,10000)) do
begin
writeln('bscreen: ' + booltostr(BankScreen));
writeln('pscreen: ' + booltostr(PinScreen));
writeln(TimeFromMark(T));
wait(100+random(50));
end;
The open bank chest function , and the one containing that loop, is here:
Simba Code:
function PinAndBankTest:Boolean;
var
T : LongInt;
begin
if not LoggedIn then
Exit;
Result := false;
DebugStr(3,'Waiting for bank and pin screens...');
MarkTime(T);
while (not BankScreen) and (not PinScreen) and (TimeFromMark(T) < RandomRange(5000,10000)) do
begin
writeln('bscreen: ' + booltostr(BankScreen));
writeln('pscreen: ' + booltostr(PinScreen));
writeln(TimeFromMark(T));
wait(100+random(50));
end;
if PinScreen then
begin
DebugStr(2,'Entering pin...');
if Length(Players[CurrentPlayer].Pin) = 0 then
begin
DebugStr(2,'You did not set a pin, but we are in the pin screen... ' +
'Next player...');
Logout;
NextPlayer(False);
Exit;
end;
inpin(Players[CurrentPlayer].Pin);
end;
DebugStr(3,'Waiting for bank screen...');
MarkTime(T);
while not BankScreen and (TimeFromMark(T) < 5000) do
wait(50+random(50));
Result := BankScreen;
if Result then
begin
DebugStr(2,'Bank opened succesfully');
FixBank;
end else
DebugStr(2,'Did not find Bank Screen');
end;
function Open_BankChest : Boolean;
var
OpenSuccess : Boolean;
a,b,I : Integer;
TP : TPoint;
ChestTPA : TPointArray;
ChestATPA : T2DPointArray;
begin
Result := False;
//first try the recorded bank spot
MakeCompass('e');
SetAngle(SRL_ANGLE_HIGH);
MMouse(ChestBankPoint.x,ChestBankPoint.y,6,6);
DebugStr(3,'Testing for BankChest');
if TestRightClickMenu(['Bank'],ChestBankPoint,4,4,1,true) then
begin
DebugStr(3,'Remembered Bank Chest position, opening bank...');
ChooseOption('Bank');
end else
DebugStr(3,'Did not remember bank chest position, searching now...');
SetColorToleranceSpeed(2)
SetColorspeed2Modifiers(0.110,0.49);
FindColorsSpiralTolerance(a,b,ChestTPA,11974595,MSX1,MSY1,MSX2,MSY2,14);
ChestATPA := TPAtoATPA(ChestTPA,40);
DebugStr(5,'Looping ' +inttostr(Length(ChestATPA)-1) + ' times in search of bank chest');
for I := 0 to Length(ChestATPA)-1 do
begin
TP := MiddleTPA(ChestATPA[I]);
if TestRightClickMenu(['Bank'],TP,3,3,1,false) then
begin
OpenSuccess := ChooseOption('Bank');
DebugStr(3,'Found Bank Chest; Banking success: '+BoolToStr(OpenSuccess));
if OpenSuccess then
begin
ChestBankPoint := TP;
break;
end;
end;
end;
if OpenSuccess then
Result := PinAndBankTest;
end;
Anyone see anything I'm missing?