From: riwu
Yeah tons of ATPA/TPA sorting functions, just search through the function list. You may want to use wrapper functions.
I'm looking through them atm. Wrapper assigns the returned ATPA to x variable? I dont see any other difference between it and the other one.
E: I found SortATPAFrom and SortTPAFrom. This is how I believe you use it, could someone let me know if I'm doing it right, or if theres a better way to do it?
Function BankfromBank:boolean;
var
BankTPA:TPointArray;
BankATPA:T2DPointArray;
i:integer;
begin
if FindcolorsTolerance(BankTPA, color, MSX1, MXY1, MSX2, MSY2, tol) then
writeln('We found possible colors!') else
begin
writeln('We didnt find any colors for the BankTPA!');
Exit;
end;
BankATPA := SplitTPAex(BankTPA, 10, 10);
SortATPAFrom(BankATPA, point(0, 700));
L := High(BankATPA);
for i := 0 to L do
begin
mmouse(BankATPA[0][i].x, BankATPA[0][i].y, 5, 5);
if waituptext('Bank Uptext', 500) then
begin
writeln('We found the bank! Lets click on it!');
clickmouse(2);
break;
end;
end;
end;