Well, I'm no expert at TPAs but I know the foundation stuff.
If you set the size of the TPA using this function:
SCAR Code:
TPAtoATPAEx({TPA: TPointArray}, {width: LongInt}, {height: LongInt});
After you've found your colour, then it will only find objects that are atleast the size you specify.
Then when you want to check whether its the object you are looking for just use something simple like IsUpText or IsUpTextMulti.
Sometimes I find having an example helps, so this is the one for the fountain in my clay softner, its not great but oh well:
SCAR Code:
Function LocateFountain:Boolean;
Var
TPA: TPointArray;
Temp: T2DPointArray;
h, x, y, z, t, i: Integer;
begin
If not LoggedIn then
Exit;
If Players[CurrentPlayer].Loc = 'bank' then Exit;
DTMs;
If FindDTM(EmptyBucket, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
Mouse(x, y, 5, 5, true);//Important stuff starts here
t := GetSystemTime;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(x, y, TPA, 14066055, MSX1, MSY1, MSX2, MSY2, 19);
Temp := TPAtoATPAEx(TPA, 40, 40);
SortATPASize(Temp, True);
h := High(Temp);
For z := 0 to h do
Begin
MiddleTPAex(Temp[z], x, y);
MMouse(x, y, 5, 5);
i := 0;
AntiRandoms;
Repeat
Wait(50+random(20));
i := i + 1;
AntiRandoms;
Until IsUpText('ountain') or (i = 25);
Result := IsUpText('ountain');
If Result then
break;
Wait(100);
end;
If Result then
Begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
WriteLN('Found the fountain in '+IntToStr(((GetSystemTime) - t)- 100)+' msecs');
end; //Important stuff ends here
If (i = 25) then
Begin
AntiRandoms;
WriteLN('Couldn'#39't find the fountain');
Logout;
end;
AntiBan;
MarkTime(t)
Repeat
Wait(1000+random(2000));
AntiRandoms;
Until(Not(FindDTM(EmptyBucket, x , y, MIX1, MIY1, MIX2, MIY2))) or (TimeFromMark(t) >= 25000);
FreeDTMs;
end;
end;
Ignore all the irelavent stuff like the DTMs and the waiting and its quite easy to pick apart.