SCAR Code:
program AlKharidTanner;
{.include SRL\SRL.scar}
var
x, y: Integer;
function Floor1Color: Integer;
var
i, Red, Green, Blue, GC, TestColor, CX, CY: Integer;
P: TPointArray;
H, S, L: Extended;
begin
GC := 6061218;
FFlag(0);
if (FindSymbol(x, y, 'bank')) then
begin
CX := x;
CY := y;
end else
begin
CX := MMCX;
CY := MMCY;
end;
FindColorsSpiralTolerance(CX, CY, P, GC, MMX1, MMY1, MMX2, MMY2, 30);
for i := 0 to High(P) - 1 do
begin
if rs_OnMinimap(P[i].x,P[i].y) then
begin
TestColor := GetColor(P[i].x, P[i].y);
ColorToRGB(TestColor, Red, Green, Blue);
ColorToHSL(TestColor, H, S, L);
if InRange(Red - Blue, 58, 82) then
if InRange(Red - Green, 22, 54) then
if InRange(Green - Blue, 19, 47) then
if InRange(Round(S - H), 14, 31) then
if InRange(Round(L - H), 32, 52) then
if InRange(Round(L - S), 13, 26) then
if GetColor(P[i].x + 2, P[i].y + 2) = TestColor then
if GetColor(P[i].x + 1, P[i].y + 1) = TestColor then
if GetColor(P[i].x, P[i].y + 2) = TestColor then
if GetColor(P[i].x + 2, P[i].y) = TestColor then
if GetColor(P[i].x, P[i].y + 1) = TestColor then
if GetColor(P[i].x + 1, P[i].y) = TestColor then
if GetColor(P[i].x + 2, P[i].y + 1) = TestColor then
if GetColor(P[i].x + 1, P[i].y + 2) = TestColor then
begin
Result := TestColor;
Writeln('Floor1Color = ' + IntToStr(Result));
Exit;
end;
end;
end;
Writeln('Floor1Color could not be found.');
Result := 0;
end;
function Floor2Color: Integer;
var
i, Red, Green, Blue, GC, TestColor: Integer;
P: TPointArray;
H, S, L: Extended;
begin
GC := 6983098;
FFlag(0);
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 30);
for i := 0 to High(P) - 1 do
begin
if rs_OnMinimap(P[i].x,P[i].y) then
begin
TestColor := GetColor(P[i].x, P[i].y);
ColorToRGB(TestColor, Red, Green, Blue);
ColorToHSL(TestColor, H, S, L);
if InRange(Red - Blue, 70, 90) then
if InRange(Red - Green, 32, 67) then
if InRange(Green - Blue, 17, 53) then
if InRange(Round(S - H), 23, 40) then
if InRange(Round(L - H), 44, 59) then
if InRange(Round(L - S), 13, 25) then
if GetColor(P[i].x + 2, P[i].y + 2) = TestColor then
if GetColor(P[i].x + 1, P[i].y + 1) = TestColor then
if GetColor(P[i].x, P[i].y + 2) = TestColor then
if GetColor(P[i].x + 2, P[i].y) = TestColor then
if GetColor(P[i].x, P[i].y + 1) = TestColor then
if GetColor(P[i].x + 1, P[i].y) = TestColor then
if GetColor(P[i].x + 2, P[i].y + 1) = TestColor then
if GetColor(P[i].x + 1, P[i].y + 2) = TestColor then
begin
Result := TestColor;
Writeln('Floor2Color = ' + IntToStr(Result));
Exit;
end;
end;
end;
Writeln('Floor2Color could not be found.');
Result := 0;
end;
function CactiColor: Integer;
var
i, Red, Green, Blue, GC, TestColor: Integer;
P: TPointArray;
H, S, L: Extended;
begin
GC := 3240012;
FFlag(0);
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 50);
for i := 0 to High(P) - 1 do
begin
if rs_OnMinimap(P[i].x,P[i].y) then
begin
TestColor := GetColor(P[i].x, P[i].y);
ColorToRGB(TestColor, Red, Green, Blue);
ColorToHSL(TestColor, H, S, L);
if InRange(Red - Blue, 3, 35) then
if InRange(Green - Red, 19, 60) then
if InRange(Green - Blue, 38, 78) then
if InRange(Round(S - H), -9, 30) then
if InRange(Round(L - H), -6, 16) then
if InRange(Round(L - S), -32, 16) then
if GetColor(P[i].x + 2, P[i].y + 2) = TestColor then
if GetColor(P[i].x + 1, P[i].y + 1) = TestColor then
if GetColor(P[i].x, P[i].y + 2) = TestColor then
if GetColor(P[i].x + 2, P[i].y) = TestColor then
if GetColor(P[i].x, P[i].y + 1) = TestColor then
if GetColor(P[i].x + 1, P[i].y) = TestColor then
if GetColor(P[i].x + 2, P[i].y + 1) = TestColor then
if GetColor(P[i].x + 1, P[i].y + 2) = TestColor then
begin
Result := TestColor;
Writeln('CactiColor = ' + IntToStr(Result));
Exit;
end;
end;
end;
Writeln('CactiColor could not be found.');
Result := 0;
end;
function TreeBaseColor: Integer;
var
i, Red, Green, Blue, GC, TestColor: Integer;
P: TPointArray;
H, S, L: Extended;
begin
GC := 1130626;
FFlag(0);
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 50);
for i := 0 to High(P) - 1 do
begin
if rs_OnMinimap(P[i].x,P[i].y) then
begin
TestColor := GetColor(P[i].x, P[i].y);
ColorToRGB(TestColor, Red, Green, Blue);
ColorToHSL(TestColor, H, S, L);
if InRange(Red - Blue, 100, 138) then
if InRange(Red - Green, 57, 89) then
if InRange(Green - Blue, 27, 66) then
if InRange(Round(S - H), 51, 98) then
if InRange(Round(S - L), 23, 82) then
if InRange(Round(L - H), 12, 32) then
if GetColor(P[i].x, P[i].y + 1) = TestColor then
begin
Result := TestColor;
Writeln('TreeBaseColor = ' + IntToStr(Result));
Exit;
end;
end;
end;
Writeln('TreeBaseColor could not be found.');
Result := 0;
end;
function Walk1DDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..5] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 76;
dtmMainPoint.y := 25;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 6262182;
dtmMainPoint.Tolerance := 255;
dtmSubPoints[0].x := 76;
dtmSubPoints[0].y := 25;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 6262182;
dtmSubPoints[0].Tolerance := 255;
dtmSubPoints[1].x := 58;
dtmSubPoints[1].y := 7;
dtmSubPoints[1].AreaSize := 20;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := Floor2Color;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 31;
dtmSubPoints[2].y := 9;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 1;
dtmSubPoints[2].Color := CactiColor;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 80;
dtmSubPoints[3].y := 48;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 1;
dtmSubPoints[3].Color := CactiColor;
dtmSubPoints[3].Tolerance := 0;
dtmSubPoints[4].x := 49;
dtmSubPoints[4].y := 43;
dtmSubPoints[4].AreaSize := 16;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := Floor1Color;
dtmSubPoints[4].Tolerance := 0;
dtmSubPoints[5].x := 12;
dtmSubPoints[5].y := 16;
dtmSubPoints[5].AreaSize := 16;
dtmSubPoints[5].AreaShape := 0;
dtmSubPoints[5].Color := 800886;
dtmSubPoints[5].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
function Walk2DDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 66;
dtmMainPoint.y := 16;
dtmMainPoint.AreaSize := 15;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := Floor2Color;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 66;
dtmSubPoints[0].y := 16;
dtmSubPoints[0].AreaSize := 15;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := Floor2Color;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 25;
dtmSubPoints[1].y := 53;
dtmSubPoints[1].AreaSize := 5;
dtmSubPoints[1].AreaShape := 1;
dtmSubPoints[1].Color := CactiColor;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 73;
dtmSubPoints[2].y := 103;
dtmSubPoints[2].AreaSize := 5;
dtmSubPoints[2].AreaShape := 1;
dtmSubPoints[2].Color := CactiColor;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 7;
dtmSubPoints[3].y := 42;
dtmSubPoints[3].AreaSize := 5;
dtmSubPoints[3].AreaShape := 1;
dtmSubPoints[3].Color := 800886;
dtmSubPoints[3].Tolerance := 255;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
function Walk3DDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 45;
dtmMainPoint.y := 116;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 6196132;
dtmMainPoint.Tolerance := 255;
dtmSubPoints[0].x := 45;
dtmSubPoints[0].y := 116;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 6196132;
dtmSubPoints[0].Tolerance := 255;
dtmSubPoints[1].x := 83;
dtmSubPoints[1].y := 12;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 1;
dtmSubPoints[1].Color := CactiColor;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 67;
dtmSubPoints[2].y := 15;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := CactiColor;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 41;
dtmSubPoints[3].y := 15;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 1;
dtmSubPoints[3].Color := CactiColor;
dtmSubPoints[3].Tolerance := 0;
dtmSubPoints[4].x := 2;
dtmSubPoints[4].y := 85;
dtmSubPoints[4].AreaSize := 4;
dtmSubPoints[4].AreaShape := 1;
dtmSubPoints[4].Color := CactiColor;
dtmSubPoints[4].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
function Walk4DDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 50;
dtmMainPoint.y := 125;
dtmMainPoint.AreaSize := 16;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := Floor1Color;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 50;
dtmSubPoints[0].y := 125;
dtmSubPoints[0].AreaSize := 16;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := Floor1Color;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 102;
dtmSubPoints[1].y := 79;
dtmSubPoints[1].AreaSize := 16;
dtmSubPoints[1].AreaShape := 1;
dtmSubPoints[1].Color := Floor1Color;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 52;
dtmSubPoints[2].y := 62;
dtmSubPoints[2].AreaSize := 16;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := Floor2Color;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 77;
dtmSubPoints[3].y := 107;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 1;
dtmSubPoints[3].Color := CactiColor;
dtmSubPoints[3].Tolerance := 0;
dtmSubPoints[4].x := 17;
dtmSubPoints[4].y := 64;
dtmSubPoints[4].AreaSize := 4;
dtmSubPoints[4].AreaShape := 1;
dtmSubPoints[4].Color := CactiColor;
dtmSubPoints[4].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
procedure WalkToTanner;
begin
DTMRotated(Walk1DDTM, x, y, MMX1, MMY1, MMX2, MMY2);
Mouse(x, y, 4, 4, True);
FFlag(5);
FreeDTM(Walk1DDTM);
DTMRotated(Walk2DDTM, x, y, MMX1, MMY1, MMX2, MMY2);
Mouse(x, y, 4, 4, True);
FFlag(5);
FreeDTM(Walk2DDTM);
end;
procedure WalkToBank;
begin
DTMRotated(Walk3DDTM, x, y, MMX1, MMY1, MMX2, MMY2);
Mouse(x, y, 4, 4, True);
FFlag(5);
FreeDTM(Walk3DDTM);
DTMRotated(Walk4DDTM, x, y, MMX1, MMY1, MMX2, MMY2);
Mouse(x, y, 4, 4, True);
FFlag(5);
FreeDTM(Walk4DDTM);
end;
begin
SetupSRL;
ActivateClient;
WalkToTanner;
WalkToBank;
end.