Im making a script to mine and bank clay at Ardounge (Was running fine till I made a change to speed it up)
I want the script to walk to the bank, then bank the clay. If it starts in the bank, it banks fine, if it has to go to the walking procedure, it gets stuck.
So Ive narrowed it down to the procedure that causes issues
Simba Code:
Procedure GetIntoBank;
var
TPA: TPointArray;
ATPA: T2DPointArray;
i, L: Integer;
P: TPoint;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.00);
if FindColorsSpiralTolerance(X, Y, TPA, 8618893 , MMX1, MMY1, MMX2, MMY2, 3) then
begin
ATPA := TPAtoATPAEx(TPA, 10, 10);
SortATPAFromFirstPoint(ATPA, Point(690, 93));
//DebugATPA(ATPA, '');
L:=High(ATPA)
for i:=0 to L do
if GetArrayLength(ATPA[i]) > 5 then
begin
P := MiddleTPA(ATPA[i]);
Mouse(P.x, P.y, 3, 3, True);
wait(RandomRange(250,300));
FFlag(1);
end;
end;
end;
The script should click one of the lighter colored tiles in the bank, then wait until the flag is gone and exit, and continue to bank, but sometimes it will click more than once, other times it will then just stop at this point.
Main Loop :
Simba Code:
begin
Setup;
repeat
while not LoggedIn do
repeat
LogInPlayer;
until(LoggedIn);
if (not InvFull and not AtRocks) then
WalkToRocks;
if (not InvFull and AtRocks) then
MineRocks;
if (InvFull and AtBank) then
DoBanking;
if (InvFull and not AtBank) then
WalkToBank;
until(False);
end.
Walking to Bank Procedure:
Simba Code:
function WalkToBank: Boolean;
var
ToBank: TPointArray;
begin
FindNormalRandoms;
ToBank :=[Point(272,156),Point(272,166),Point(272,174),Point(270,187),Point(265,202),Point(261,218),Point(258,230),Point(247,245),Point(239,260),Point(231,276),Point(227,284),Point(222,301),Point(216,307),Point(205,312),Point(194,320),Point(188,331),Point(184,343),Point(188,347)];
if SPS_WalkPath(ToBank) then
begin
FindNormalRandoms;
GetIntoBank;
result := True;
Status := 'At the bank';
Writeln('Status:' + Status);
exit;
end
else
begin
FindNormalRandoms;
Status := 'Did not walk to the bank, shutting down.';
Writeln('Status:' + Status);
result := false;
TerminateScript;
end;
end;
So how do I get it to continue past this? Everything was working until I added GetIntoBank as a procedure, ideas?