findcolorsSpiralTolerance, TPA, ATPA, T2DPointArray.
I am trying to write a find bank procedure sine the built in one doesn't want to work for me.
I found this tut by camel and it was super useful sending me in the right direction.
but some of it doesnt work anymore, specifically the function that would have been most useful to me.
I have it noted in the simba code at bottom.
the first thing that came to mind was something like
Simba Code:
while length.ATPA > 0 do
ATPA.deleteIndex(1);
but i'm not sure how or if i can get the length of an ATPA.
i found a temporary fix that would work for this specific compass position, camera angle, and zoom.
what could i do instead?
is there a better way i should go about doing this?
Simba Code:
procedure findbank;
var
x,y : Integer;
TPA, bTPA : TPointArray;
ATPA : T2DPointArray;
begin
findColorsSpiralTolerance(x, y, TPA, 2181468, mainScreen.getBounds(), 2, colorSetting(2, 4.56, 3.37));
if (Length(TPA) < 1) then
begin
WriteLn('Failed to find bank counter colors');
Exit;
end;
ATPA := TPA.toATPA(55, 20);
ATPA.sortFromMidPoint(Mainscreen.playerPoint);
FilterTPAsBetween(ATPA,1,200);
ATPA.deleteIndex(1); // this is what i use for this specific instance to filter to the only one i want.
ATPA.deleteIndex(1); // since there are only 3 total given the right camera angle it works.
//ATPA.excludePointsDist(0, 500 , TRSMainscreen.playerPoint.x, TRSMainscreen.playerPoint.y); // this is what i found in tutorial but it doesnt work anymore.
SmartImage.debugATPA(ATPA);
//SmartImage.debupTPA(bTPA);
end;