SCAR Code:
function TinColour: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 10000547, MMX1, MMY1, MMX2, MMY2, 7);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 0.00) and (H <= 1.41) and (S >= 5.40) and (S <= 6.40) and (L >= 60.18) and (L <= 63.16) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 30.21) and (X <= 33.76) and (Y >= 30.67) and (Y <= 34.38) and (Z >= 32.32) and (Z <= 35.88) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function CopperColour: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.16, 0.26);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 8498363, MMX1, MMY1, MMX2, MMY2, 29);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 115) and (R <= 237) and (G >= 83) and (G <= 237) and (B >= 53) and (B <= 226) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 11.02) and (X <= 78.20) and (Y >= 10.30) and (Y <= 83.28) and (Z >= 4.88) and (Z <= 83.19) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Heres both of them, I think the problems to do when I toggled the minimap but anyway.