I'm not use what your procedure is about. Are you trying to walk to bank and the script is coded to try to go from different locations? If so, I would add a Break; to the loop to avoid any possible issue/save memory.
I would write something like:
procedure BankMap;
var
i, x, y, InBank: integer;
aFound: extended;
TPA : TPointArray;
begin
if not (LoggedIn) then
Exit;
TPA := [Point(2300, 3323), Point(2313, 3323), Point(2290, 3322)];
writeln('Can''t see the bank, trying again');
for i := 0 to high(TPA) do
begin
writeln('Attempt ' + IntToStr(i + 1));
ToPot := TPA[i];
SPS_WalkPath(ToPot);
Wait(RandomRange(2000,3000));
InBank := DTMFromString('mQwAAAHicY2ZgYHgIxJ+B+DwQWzAyMCQDcRIQtzWWMCQK8zLMkhdlMALK8UMxIxIGAgA1mQbE');
if FindDTMRotated(InBank, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
mouse(5, 5, x, y, Mouse_left);
wait(randomrange(1000,2000)); //Is this waiting for the bank to bank? You might prefer something like WaitFunc(@BankScreen, 10, 3000);
FreeDTM(InBank);
Break;
end;
end;
end;
I'll repeat a tip that I read on another thread that helped me a great deal. Don't just copy the procedure (anyway I probably made it typo somewhere). Try to understand it.