I came up with this autocoloring function:
SCAR Code:
function GraveYard: Boolean;
var
I, R, G, B, Len, TestColor: Integer;
H, S, L, X, Y, Z: Extended;
P: TPointArray;
begin
Result := False;
FFlag(0);
FindColorsSpiralTolerance(MMCX, MMCY, P, 1784393, MMX1, MMY1, MMX2, MMY2, 60);
Len := High(P);
for I := 0 to Len do
if RS_OnMinimap(P[I].X, P[I].Y) then
begin
TestColor := GetColor(P[I].X, P[I].Y);
ColorToRGB(TestColor, R, G, B);
if InRange(R - B, 26, 66) then
if InRange(R - G, -5, 35) then
if InRange(G - B, 11, 51) then
begin
ColorToHSL(TestColor, H, S, L);
if InRange(Round(H - L), -23, 7) then
if InRange(Round(S - H), 20, 50) then
if InRange(Round(S - L), 11, 41) then
begin
ColorToXYZ(TestColor, X, Y, Z);
if InRange(Round(X - Y), -7, 7) then
if InRange(Round(Y - Z), -4, 10) then
begin
Mouse(P[I].X, P[I].Y, 6, 6, True);
Result := True;
Exit;
end;
end;
end;
end;
WriteLn('We didn''t find the graveyard color!');
end;
but i'm having this error:
SCAR Code:
Line 273: [Error] (17136:47): Type mismatch in script C:\Program Files (x86)\SCAR 3.20\Scripts\Ore Heroe.scar
this is line 273:
SCAR Code:
If RadialWalk(GraveYard, 0, 360, 70, -1,-1) Then
help, anyone? This is my first time autocoloring