SCAR Code:
function FindBridgeColors: Integer;
var
GC, A, L, TestColor, x, y: integer;
P: TPointArray;
begin
if (WaterColor = 0) then
WaterColor := FindWaterColor;
if (not (FindColor(X, Y, WaterColor, MMX1, MMY1, MMX2, MMY2))) then
WaterColor := FindWaterColor;
if (WaterColor = 0) then
begin
Result := 0;
Exit;
end;
GC := 1389645;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
L := GetArrayLength(P);
for A := 0 to L-1 do
begin
if rs_OnMinimap(P[A].X, P[A].Y) and rs_OnMinimap(P[A].X-1, P[A].Y) then
begin
TestColor := GetColor(P[A].X, P[A].Y);
if (GetColor(P[A].X-1, P[A].Y) = TestColor+395277) then
begin
if (FindColor(X, Y, WaterColor, P[A].X-3, P[A].Y-3, P[A].X+3, P[A].Y+3)) then
begin
Result := TestColor;
WriteLn('Bridge Color = ' + IntToStr(TestColor));
Exit;
end;
end
else
begin
if (InRange(iAbs(TestColor - GetColor(P[A].X-1, P[A].Y)), 264205, 395277)) then
if (FindColor(X, Y, WaterColor, P[A].X-3, P[A].Y-3, P[A].X+3, P[A].Y+3)) then
begin
Result := TestColor;
WriteLn('Bridge Color = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find Bridge Color.');
Result := 0;
end;
I found out the difference changes every 12 hours i think, anyways i added a fail safe if yours fail ;p