noidea
2009-04-05 00:47:27
{********************************************
Function : Function FindBridgeColor2: Integer;
Author : noidea
Description : Made this since the old one is
broken. It find the bridge color.
*********************************************}
Function FindBridgeColor2: Integer;
var
p: Array of TPoint;
GC, i, testColour1, c, x, y: Integer;
begin
If WaterColor = 0 then
WaterColor := FindWaterColor;
If FindWaterColor = 0 then
begin
Writeln('There was no water nearby!');
Result := 0;
exit;
end;
GC := 10803;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 65);
//debugtpa(p, '');
If length(p) = 0 then
begin
writeln('Unable to find Bridge Color!');
result := 0;
exit;
end;
c := GetArrayLength(P);
For i := 0 to c - 1 do
begin
if rs_OnMinimap(P[i].x,P[i].y) then
begin
TestColour1 := GetColor(P[i].x, P[i].y);
if GetColor(P[i].x - 2, P[i].y) = TestColour1 then
if getcolor(P[i].x + 4 , P[i].y + 4) = testcolour1 then
if FindColor(x, y, WaterColor, P[i].x - 3, P[i].y - 3, P[i].x + 3, P[i].y + 3) then
begin
Result := TestColour1;
Writeln('Bridge color = '+inttostr(Result));
exit;
end;
end;
end;
Writeln('Could not find Bridge Color!');
Result := 0;
end;Hasnt failed me.