SRL Archive - SRL Archives

FindBridgeColor2;


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.

mormonman

2009-04-05 01:00:59

Lol… was this fueled by my inability to make one? BTW, mine is now amazing… I did a water check thing like this and it hasn't failed yet. Neither has the whole walking procedure!

noidea

2009-04-05 01:29:03

From: mormonman
Lol… was this fueled by my inability to make one? BTW, mine is now amazing… I did a water check thing like this and it hasn't failed yet. Neither has the whole walking procedure!


No it wasnt :p
I made it a few days ago, when I realised SRL's was broken. I just decided to release it. (Why not lol)


btw, Im glad your stuff is working. PB the stuff some time so I can see :)

mormonman

2009-04-05 01:34:22

From: noidea
No it wasnt :p
I made it a few days ago, when I realised SRL's was broken. I just decided to release it. (Why not lol)


btw, Im glad your stuff is working. PB the stuff some time so I can see :)


Still no failsafes… I was watchin final four games

Quickmarch

2009-04-05 03:21:57

What about comparing the RGB values?

noidea

2009-04-05 03:52:08

From: Quickmarch
What about comparing the RGB values?


I didnt want to when there are faster methods, like this one.

Nose Smasher

2009-04-05 13:29:19

only prob is sometimes FindWaterColor Fails… :p

noidea

2009-04-05 13:37:44

FindWaterColor never fails for me.

Nava2

2009-04-05 14:51:58

If you are going to use this method, you need to make sure you add more GetColors.