@Tara
I looked into it and it was indeed the first problem. It searches with a tolerance of 80 but that isn't enough at times. The ratio between the adjacent pixels are still the same.
Using color tolerance speed 2 I was able to make a stable function. If anyone wants to use it go ahead.
SCAR Code:
Function FindRockColor2: Integer;
var
TPA: TPointArray;
i,CTS,c1,c2: Integer;
begin
if(not(LoggedIn))then Exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(3.34,0.25);
FindColorsSpiralTolerance(mmcx,mmcy,TPA,4605506,mmx1,mmy1,mmx2,mmy2,60);
if(Length(TPA) = 0)then
begin
Writeln('Failed.');
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.20,0.20);
Result := -1;
Exit;
end;
for i := 0 to High(TPA) do
begin
c1 := GetColor(TPA[i].x,TPA[i].y);
c2 := GetColor(TPA[i].x,TPA[i].y + 1);
if((c1 - c2) = 1250837)then
begin
Result := c1;
Exit;
end;
end;
Writeln('RockColor finding failed.');
Result := -1;
end;
@NoIdea
The FindTreeColor is working awesome! I am also using it for my DDTMs in this script