SCAR Code:
function StoreAutoColor: Integer; //thanks to Scar Assistant
var
I, R, G, B, Len, TestColor: Integer;
H, S, L, X, Y, Z: Extended;
P: TPointArray;
begin
Result := -1;
FFlag(0);
FindColorsSpiralTolerance(MMCX, MMCY, P, 6447978, 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, -12, 28) then
if InRange(R - G, -13, 27) then
if InRange(G - B, -19, 21) then
begin
ColorToHSL(TestColor, H, S, L);
if InRange(Round(H - L), -53, -23) then
if InRange(Round(S - H), -13, 17) then
if InRange(Round(S - L), -51, -21) then
begin
ColorToXYZ(TestColor, X, Y, Z);
if InRange(Round(X - Y), -7, 7) then
if InRange(Round(Y - Z), -8, 6) then
begin
Result := TestColor;
Exit;
end;
end;
end;
end;
WriteLn('Autocolor did not find the color.');
end;
function WalkToStoreAutoColor: Integer;
var
I, R, G, B, Len, TestColor: Integer;
H, S, L, X, Y, Z: Extended;
P: TPointArray;
begin
Result := -1;
FFlag(0);
FindColorsSpiralTolerance(MMCX, MMCY, P, 7435130, 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, -11, 29) then
if InRange(R - G, -13, 27) then
if InRange(G - B, -18, 22) then
begin
ColorToHSL(TestColor, H, S, L);
if InRange(Round(H - L), -57, -27) then
if InRange(Round(S - H), -15, 15) then
if InRange(Round(S - L), -57, -27) then
begin
ColorToXYZ(TestColor, X, Y, Z);
if InRange(Round(X - Y), -7, 7) then
if InRange(Round(Y - Z), -8, 6) then
begin
Result := TestColor;
Exit;
end;
end;
end;
end;
WriteLn('Autocolor did not find the color.');
end;
function LoadAllDTMWalks(WalkNumber: Integer): Integer; //thanks to BoBBoHoBBo's guide to ddtm walking
var // and thanks to EvilChicken! for making it work^^
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..4] of TDTMPointDef;
TempTDTM: TDTM;
Color: Integer;
begin
case WalkNumber of
1: begin
Color := WalkToStoreAutoColor;
dtmMainPoint.x := 734;
dtmMainPoint.y := 282;
dtmMainPoint.Color := Color;
dtmSubPoints[0].x := 734;
dtmSubPoints[0].y := 282;
dtmSubPoints[0].Color := Color;
dtmSubPoints[1].x := 736;
dtmSubPoints[1].y := 295;
dtmSubPoints[1].AreaSize := 3;
dtmSubPoints[1].Color := Color;
dtmSubPoints[2].x := 734;
dtmSubPoints[2].y := 271;
dtmSubPoints[2].AreaSize := 2;
dtmSubPoints[2].Color := Color;
dtmSubPoints[3].x := 727;
dtmSubPoints[3].y := 265;
dtmSubPoints[3].AreaSize := 2;
dtmSubPoints[3].Color := Color;
dtmSubPoints[4].x := 729;
dtmSubPoints[4].y := 260;
dtmSubPoints[4].AreaSize := 3;
dtmSubPoints[4].Color := Color;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
2: begin
Color := StoreAutoColor;
dtmMainPoint.x := 694;
dtmMainPoint.y := 287;
dtmMainPoint.Color := Color;
dtmSubPoints[0].x := 694;
dtmSubPoints[0].y := 287;
dtmSubPoints[0].Color := Color;
dtmSubPoints[1].x := 699;
dtmSubPoints[1].y := 283;
dtmSubPoints[1].Color := Color;
dtmSubPoints[2].x := 701;
dtmSubPoints[2].y := 290;
dtmSubPoints[2].Color := Color;
dtmSubPoints[3].x := 689;
dtmSubPoints[3].y := 288;
dtmSubPoints[3].Color := Color;
dtmSubPoints[4].x := 696;
dtmSubPoints[4].y := 277;
dtmSubPoints[4].Color := Color
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
end;
end;
function WalkToStore: Boolean;
var
WalkDTM: integer; // Calls the WalkDTM making walking simpler.
begin
WalkDTM := LoadAllDTMWalks(1); //Load which DDTM you want to find.
if FindDTM(WalkDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then // Find the DDTM using Find DTM
begin
Mouse(X, Y, 5, 5, True);
WriteLn('point 1 found');
FFlag(0);
Result := True; // If succesfully finds it will click it and wait to flag is gone.
end else
if DTMRotated(WalkDTM, X, Y, MMX1, MMY1, MMX2, MMY2) then
Begin
Mouse(X, Y, 5, 5, True);
WriteLn('point 1 FS done');
FFlag(0);
Result :=True;
end else
begin
Result :=False
Writeln(' FS Failed... abort');
FreeDTM(WalkDTM);
if not (Result) then
begin
Logout;
Exit;
end;
end;
end;