Example:
You are looking for a tree color. There are a few pieces of grass around that have almost the same color as the tree color. This is what I would do:
SCAR Code:
var
T, T2: TPointArray;
i: Integer;
FindColorsSpiralTolerance(T,2786153,MSX1,MSY1,MSX2,MSY2,4);
for I := 0 to High(T) do
begin
FindColorsSpiralTolerance(T2,2786153,T[i].x-20,T[i].y-20,T[i].x+20,T[i].y+20);
if(GetArrayLength(T2) > 25)then
begin
Writeln('More than 25 colors around the point, so it''s probably the tree');
MMouse(T[i].x,T[i].y,4,4);
if(IsUpText('Tree'))then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
Writeln('Found the tree');
break;
end;
end;
end;
So first you store all the points on the screen with the color (and a tolerance of 4) in the T array. Then go through each point, check if within 20 pixels all the way around there are over 25 similar colors (makes it more likely it is the tree that way), and check if the tree is there. If not, then it will move onto the next point.
You could not do that with FindColorTolerance. if you just did
SCAR Code:
if(FindColorTolerance(x,y,2786153,MSX1,MSY1,MSX2,MSY2,4))then
begin
MMouse(x,y,4,4);
if(IsUpText('Chop'))then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
end;
end;
This would just check the screen for the color once. If it was found it would check if that is the tree by the uptext. If this was not the tree, it would not continue to check other spots on the screen for the color.
Somebody will probably post here with more knowledge on TPA's than I and tell you to make custom ones or something, idk. To me this seems like a good method though for looking for lots of different objects on the screen (rocks, trees...etc. Even bank booths). This is how I used to do it in my old (really old) Varrock Lumberjack wood cutter which cut all trees in varrock. I had to tell the difference between oak and normal trees (pretty much exactly same colors). This did the trick because Oak trees would have a much higher array length of colors found around the point than normal trees because they are so much bigger.
Hope this helps some. I am not sure that I have many more examples though since TPA's truly aren't necessary for great object finding (but very helpful in some cases). Good logic with FindColorSkipBoxArray's could work too to check different areas of the map.