Try using this function I made for zammy wines.
function SearchForColorOnTile(var x,y:integer;tile:TTile;heigth,spread,color,tolerance,number:integer):boolean;
var pt:TPoint;
tpa:TPointArray;
begin
result := false;
if not TileOnMS(tile,heigth) then
begin
writeln('Attempting to search for color on a tile that''s outside the main screen!');
exit;
end;
pt := TileToMS(tile,heigth);
FindColorsTolerance(tpa, color, (pt.x - (spread/2)), (pt.y - (spread/2)), (pt.x + (spread/2)), (pt.y + (spread/2)), tolerance);
result := Length(tpa) >= number;
if result then
MiddleTPAEx(tpa, x, y);
end;