SRL Archive - Research & Development Lounge

RadialWalkDir


MylesMadness

2009-01-27 21:24:49

Function RadialWalkDir(Color:TColor; Dir:Char; Radius, XMod, YMod:Integer):Boolean;
var
Angle : extended;
NewStart, NewEnd, StartRadial, EndRadial: integer;
begin
case Uppercase(Dir) of
'N': begin StartRadial:=315; EndRadial:=405; end;
'S': begin StartRadial:=135; EndRadial:=225; end;
'E': begin StartRadial:=45; EndRadial:=135; end;
'W': begin StartRadial:=225; EndRadial:=15; end;
end;
Angle := rs_GetCompassAngleDegrees; //from here
NewStart := Trunc(StartRadial + Angle);
while ((NewStart) > 360) do
NewStart := NewStart - 360;
NewEnd := Trunc(EndRadial + Angle);
while ((NewEnd) > 360) do
NewEnd := NewEnd - 360; //to here by benjaa
Result:=RadialRoadWalk(Color, NewStart, NewEnd, Radius, XMod, YMod);
end;

Used like
RadialWalkDir(FindVarrockRoadColor, 'e', 76, 2, 2)

That would walk east at varrock with 76 Radius

gerauchert

2009-01-27 21:26:54

Oooo I like this!

Good job man ;)

Ultra

2009-01-27 21:36:55

Suggestion, maybe add 'NE', 'NW', 'SE', 'SW', etc… That would be good ;), seeing as it would scan only a chosen quarter of the minimap.

Sir R. M8gic1an

2009-01-28 01:47:17

it won't walk north. i'll let you figure why.

tip: http://www.villavu.com/forum/showthread.php?t=41188#15

~RM

MylesMadness

2009-01-28 10:31:56

From: Rasta Magician
it won't walk north. i'll let you figure why.

tip: http://www.villavu.com/forum/showthread.php?t=41188#15

~RM
Thanks dude. Updated first post

Shuttleu

2009-01-28 11:02:36

mabey add a bit so it doesnt work if the radius is more than a certain amount?

~shut

EDIT: so mabey
if Radius > 75 then
begin
Writeln('Radius is too large and may cause unstable walking');
exit;
end;
just a suggestion

Smarter Child

2009-01-28 11:19:19

is this in includes, :p though this way you don't have to use 0,90,180,270

Cazax

2009-01-28 22:43:06

You could change it to start using LinearWalk, and if it fails then expand the radials using RRW until it reaches SR and ER.

Sir R. M8gic1an

2009-01-29 16:37:30

From: Cazax
You could change it to start using LinearWalk, and if it fails then expand the radials using RRW until it reaches SR and ER.


there would be no need to change the fuction much.

RWEx will call LinearWalkEx if SD = ED

therefore to walk north with RWEx all you have to do is

SD = 360; ED = 360;

it would basically be the same as just starting with smaller radiuses

~RM

Da 0wner

2009-02-03 22:58:39

From: Rasta Magician
it won't walk north. i'll let you figure why.

tip: http://www.villavu.com/forum/showthread.php?t=41188#15

~RM


No!! I can't read it :(.