FindWaterColor is seriously flawed in Falador (probable due to the easter bunny update)
by changing AutoColor (found under includes\SRL\SRL\core\AutoColor.scar) to this I've corrected most of the error
SCAR Code:
{*******************************************************************************
function FindWaterColor: Integer;
By: Tarajunky
Description: Autodetects Water Color on Minimap
*******************************************************************************}
function FindWaterColor: Integer;
var
GC, a, l, TestColor, Red, Green, Blue : integer;
var
P:array of Tpoint;
begin
GC := 12095356;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 50);
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,50) then
begin
ColorToRGB(TestColor,Red,Green,Blue);
if InRange(Green - Red, 18, 30) then
if InRange(Blue - Red, 55, 72) then
if InRange(Blue - Green, 34, 52) then
if GetColor(P[a].x + 2, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 1) = TestColor then
if GetColor(P[a].x, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 2, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 1) = 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
if GetColor(P[a].x + 1, P[a].y + 2) = TestColor then
begin
Result := TestColor;
WaterColor := TestColor;
WriteLn('WaterColor = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find Water Color!');
Result := 0;
end;
FindFaladorRoadFix
SCAR Code:
{*******************************************************************************
function FindFallyRoadColor: Integer;
By: Tarajunky
Description: Autodetects Falador Road Color on Minimap
*******************************************************************************}
function FindFallyRoadColor: Integer;
var
GC, a, l, TestColor, Red, Green, Blue : integer;
var
P:array of Tpoint;
begin
GC := 6187637;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 50);
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,50) then
begin
ColorToRGB(TestColor,Red,Green,Blue);
if InRange(Red - Blue, 18, 33)then
if InRange(Red - Green, 0, 15) then
if InRange(Green - Blue, 8, 30) then
if GetColor(P[a].x + 5, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 3) = TestColor then
if GetColor(P[a].x, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 5, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y) = TestColor then
if GetColor(P[a].x + 5, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 5) = TestColor then
begin
Result := TestColor;
WriteLn('Falador RoadColor = ' +
IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find Falador Road Color!');
Result := 0;
end;