pwnaz0r
11-21-2007, 11:04 PM
Well so many people have trouble with walking, so I decided to make this procedure. If you don't understand directions, then look it up on Wikipedia or something but I assume most should (Since the are in Runescape, North, South, East and West). Anyways, most people do not understand radialwalk and the radians, so this little procedure will walk for you by direction.
How to use the directions
this procedure is designed to find the Middle of the area you are going to search. It will then find the d (adjustment) from a 90 degree (*pure*) angle, and then divide that how many directions you give, thus decreasing the search size for every direction you give. So 'NNNN' would be more accurate than just 'N'.
Hope fully you will like. Credits go to Nielsie for helping me fix a little problem with the east :D (he added mod 360);
function Testwalk(Dir: string; Color, rx, ry: integer): boolean;
var
i, degree, d, sRadial, eRadial: integer;
begin
for i:= 1 to Length(Dir) do
begin
case Lowercase(Dir[i]) of
'n': degree:= degree+ 360;
'e': degree:= (degree+ 90) mod 360;
's': degree:= degree+ 180;
'w': degree:= degree+ 270;
else
Writeln('Invalid Direction: '+Dir[i]);
end;
end;
Writeln('Degree = '+IntToStr(degree div Length(Dir)));
d:= 90 div Length(Dir); // 90 = pure angle
sRadial:= (degree - d) mod 360;
eRadial:= (degree + d) mod 360;
Writeln('sRadial = '+IntToStr(sRadial));
Writeln('eRadial = '+IntToStr(eRadial));
result:= RadialWalk(Color, sRadial, eRadial, 60, rx, ry);
end;
How to use the directions
this procedure is designed to find the Middle of the area you are going to search. It will then find the d (adjustment) from a 90 degree (*pure*) angle, and then divide that how many directions you give, thus decreasing the search size for every direction you give. So 'NNNN' would be more accurate than just 'N'.
Hope fully you will like. Credits go to Nielsie for helping me fix a little problem with the east :D (he added mod 360);
function Testwalk(Dir: string; Color, rx, ry: integer): boolean;
var
i, degree, d, sRadial, eRadial: integer;
begin
for i:= 1 to Length(Dir) do
begin
case Lowercase(Dir[i]) of
'n': degree:= degree+ 360;
'e': degree:= (degree+ 90) mod 360;
's': degree:= degree+ 180;
'w': degree:= degree+ 270;
else
Writeln('Invalid Direction: '+Dir[i]);
end;
end;
Writeln('Degree = '+IntToStr(degree div Length(Dir)));
d:= 90 div Length(Dir); // 90 = pure angle
sRadial:= (degree - d) mod 360;
eRadial:= (degree + d) mod 360;
Writeln('sRadial = '+IntToStr(sRadial));
Writeln('eRadial = '+IntToStr(eRadial));
result:= RadialWalk(Color, sRadial, eRadial, 60, rx, ry);
end;