SRL Archive - SRL Archives

Map Walking via Distance.


XxKanexX

2006-04-10 08:31:53


Note: This WON'T Work until the next version of SRL is out. All of the root procedures and functions are in there. So for now, Just comment on how you think it would work. Unless you are a dev and have access to the rest ;)

    procedure WalkDist(Distance, RoadColor, Tol: integer; Direction: String);
    procedure WalkDistEstimate(Steps, RoadColor, Tol: Integer; Direction: String);

The whole idea of this is Map Walking via distance between the Centre of the minimap (Where the user is), And the Flag. When it mapwalks in a direction it will calculate as soon as it finds the flag the distance between both the user and flag and then add it on to an integer. As soon as the integer distance is more than the distance specified by the user it stops. Therefore walking the distance you choose.

The second one will, if you don't know the distance, estimate the distance via how many steps to take. By steps it means every time it clicks in the direction again and waits for the flag to go away, so basically every mapwalk. I suggest the second procedure if you don't know how to measure distance or the correct distance.

Examples:


WalkDist(200, 0, 7, 'S');
This will walk South by a total of 200 distance.


WalkDistEstimate(4, 0, 7, 'N');
This will walk north 4 steps (The distance is estimated in scar).


{*******************************************************************************
function EstimateDist(Steps: integer; Direction: String): integer;
By: XxKanexX
Description: returns with the estimate amount of walking distance via steps.
*******************************************************************************}
function EstimateDist(Steps: integer; Direction: String): integer;
begin
case uppercase(Direction) of
'S', 'E': result:= 37 * Steps;
'N', 'W', 'SW', 'NE': result:= 46 * Steps;
'NW': result:= 42 * Steps;
'SE': result:= 32 * Steps;
end;
end;

{*******************************************************************************
function StepsDist(Dist: Integer; Direction: String): Integer;
By: XxKanexX
Description: returns with the estimate amount of steps via the distance.
*******************************************************************************}
function StepsDist(Dist: Integer; Direction: String): Integer;
begin
result:= Trunc(Dist/(EstimateDist(1, Direction)));
end;

{*******************************************************************************
procedure WalkDist(Distance, RoadColor, Tol: integer; Direction: String);
By: XxKanexX
Description: Repeats walking in a direction for a specific amount of distance
between the Flag and User on the minimap.
*******************************************************************************}
procedure WalkDist(Distance, RoadColor, Tol: integer; Direction: String);
var TDist, buff, breaker: integer;
begin
repeat
RoadWalkGDist(buff, RoadColor, Direction, Tol);
TDist:= TDist + buff;
Wait(100 + random(50));
breaker:= breaker + 1;
until(TDist + (10 + StepsDist(Distance, Direction)) >= Distance) or (Breaker > (StepsDist(Distance, Direction)+10));
Writeln('Total Walking Distance: '+Uppercase(Direction)+', '+Inttostr(TDist));
end;

{*******************************************************************************
procedure WalkDistEstimate(Steps, RoadColor, Tol: Integer; Direction: String);
By: XxKanexX
Description: Scar generates an estimate amount of distance via steps and walks it.
*******************************************************************************}
procedure WalkDistEstimate(Steps, RoadColor, Tol: Integer; Direction: String);
begin
WalkDist(EstimateDist(Steps, Direction), RoadColor, Tol, Direction);
end;

XxKanexX

2006-04-10 08:33:54

You're probably thinking why post unless people can use it.

But i just want comments on if you think it was a good idea. You can probably guess how it works from the coding anyway. :p <3 Kane.

Sdcit

2006-04-10 13:08:31

err…….



Great job kane:D

weaselforce

2006-04-10 16:54:11

looks very hot, good idear.

Krazy_Meerkat

2006-04-10 17:12:21

Kane was testing it when we were chatting on msn. It will walk long distances no problems <3
Very useful procedure for walking a certain number of steps to a bank etc. Can't wait to test it for ya :D

ReFLeX

2006-04-10 18:17:30

From: Krazy_Meerkat
Kane was testing it when we were chatting on msn. It will walk long distances no problems <3
Very useful procedure for walking a certain number of steps to a bank etc. Can't wait to test it for ya :D

wow wow wow, this will be so cool kane. Thx

Pwnd

2006-04-10 19:54:27

Why does weasel have a cat?