Hey everyone,
Here is another autocolor function I made, for the walking between the cooking chef master and the quest guide.
I tested it several times, and it worked flawless
Please test it too, and post the result (debug) here
Here is the function:
SCAR Code:
function FindBrownRoadColor: Integer;
var
GC, a, l, TestColor, Red, Green, Blue: integer;
var
P:array of Tpoint;
begin
GC := 4221554;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 140);
l:=GetArrayLength(P);
for a:= 0 to l-1 do
begin
if rs_OnMinimap(P[a].x,P[a].y) then
begin
TestColor := GetColor(P[a].x,P[a].y);
if SimilarColors(TestColor,GC,140) then
begin
ColorToRGB(TestColor, Red, Green, Blue);
if InRange(Red - Green, 5, 33) then if Red <= 160 then
if InRange(Green - Blue, 17, 58) then
if InRange(Red - Blue, 30, 75) then if Blue <= 85 then
if GetColor(P[a].x + 1, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 2, P[a].y + 2) = TestColor then
if GetColor(P[a].x, P[a].y + 3) = TestColor then
if GetColor(P[a].x, P[a].y + 2) = TestColor then
if GetColor(P[a].x+1, P[a].y + 2) = TestColor then
if GetColor(P[a].x+2, P[a].y) = TestColor then
if GetColor(P[a].x + 1, P[a].y) = TestColor then
if GetColor(P[a].x+2, P[a].y + 1) = TestColor then
begin
Result := TestColor;
WriteLn('BrownRoadColor = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find BrownRoadColor!');
Result := 0;
end;
Thanks,
PvH