function gettrees(var ptr: TPoint): boolean;
var
tpatree, tpatreebest: TPointArray;
atpatree: array of TPointArray;
i, colortree: Integer;
ptree: TPoint;
begin
result := false;
if not LoggedIn then exit;
ptr := point(-1, -1);
colortree := AutoColor(srl_TreeColor);
findColorsTolerance(tpatree, colortree, mmx1, mmy1, mmx2, mmy2, 15);
DebugTPA(tpatree, 'a');
wait(2000);
if high(tpatree) = 0 then writeln('nope');
FilterPointsPie(tpatree, 180, 265, 10, 70, mmcx, mmcy);
DebugTPA(tpatree, 'mmtrees');
atpatree := SplitTPA(tpatree, 15);
for i := 0 to high(atpatree) do
if high(atpatree[i]) > high(tpatreebest) then
tpatreebest := atpatree[i];
DebugTPA(tpatreebest, 'tpatree');
if length(tpatreebest) < 1 then
exit;
writeln('a')
ptr := MiddleTPA(tpatreebest)
result := true;
end;
I just tried the function with colour 0 instead of AutoColoring, and I didnt get the error, but Im standing in draynor bank. Tried it with AutuColor and it did it again.