aTPA is a T2D Array, you can't just have [i] for that
edit:
oh and you missed a end; like Shuttleu pointed out
SCAR Code:
function findTrees(rx, ry: integer; colors: tintegerarray): boolean;
var
i, count: integer;
tTPA: TPointArray;
aTPA: T2DPointArray;
TP: TPoint; //Added variable
begin
count := High(colors);
for i := 0 to count do
begin
FindColorsSpiralTolerance(rx, ry, tTPA, colors[i], MSX1, MSY1, MSX2, MSY2, 5);
end;
aTPA := SplitTPA(tTPA, 5);
count := High(aTPA);
for i := 0 to count do
begin
TP := MiddleTPA(aTPA[i]); //added this whole line
MMouse(TP.x, TP.y, 0, 0); //Changed to TP.x, TP.y
Wait(250+Random(250));
if IsUpText('Chop') then
begin
Mouse(TP.x, TP.y, 0, 0, False);//Changed to TP.x, TP.y
Wait(250+Random(250));
if ChooseOption('Chop') then
begin
Result := True
Exit;
end else
WriteLn('No ChooseOption..');
end else
WriteLn('No UpText..');
end; //added end;
end;