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:
This will walk South by a total of 200 distance.Code:WalkDist(200, 0, 7, 'S');
This will walk north 4 steps (The distance is estimated in scar).Code:WalkDistEstimate(4, 0, 7, 'N');
Code:{******************************************************************************* 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;






Reply With Quote
<3 Kane.




