
Originally Posted by
ngovil21
Thanks for the quick reply. I looked at radial road walker and didn't find anything special. Also FindFaladorRoadColor wasn't working very well for me.
I updated the DTM a little to what I find is more accurate and efficient.
The script also should walk back from the furnace if start in the furnace.
Try this! Should be flawless.
Code:
function FindFallyRoadColor:integer; // By Tarajunky
var red,green,blue:integer;
var TestColor,a,b,GenericFallyRoadColor:integer;
begin
GenericFallyRoadColor:=6518652;
Flag;
a:=595;
b:=30;
repeat
b:=b+1;
repeat;
a:=a+1;
if FindColorTolerance(x,y,GenericFallyRoadColor,a,b,700,120,60) then
begin
a:=x;
b:=y;
TestColor:=GetColor(x,y);
red:=(TestColor mod 256);
green:=((TestColor/256) mod 256);
blue:=((TestColor/256) / 256);
if Red-Green>=2 then if Red-Green<=15 then
if Red-Blue>=20 then if Red-Blue<=30 then
if Green-Blue>=10 then if Green-Blue<=26 then
begin
if GetColor(a+5,b+5)=TestColor then
if GetColor(a+3,b+3)=TestColor then
if GetColor(a,b+5)=TestColor then
if GetColor(a+5,b)=TestColor then
if GetColor(a,b+3)=TestColor then
if GetColor(a+3,b)=TestColor then
if GetColor(a+5,b+3)=TestColor then
if GetColor(a+3,b+5)=TestColor then
begin
result:=TestColor;
Writeln('Falador RoadColor = '+IntToStr(TestColor));
exit;
end;
end;
end else a:=700;
until a>=700;
a:=595;
until b>=120;
Writeln('Could not find Falador Road Color!');
result:=0;
end;
Replace your roadcolor finding procedure with this and then call RoadColor:=FindFallyRoadColor in your script.
Definitely let me know how it works for you!