**BANNED The Man
2010-12-26 11:26:05
Will walk to the tile if it is a certain distance away.
Say for example you want to check if you are lost and if you are then walk back.
-Boom
Say for example you want to check if you are lost and if you are then walk back.
function WalkToTileEx(TheTile: TTile; Randomness, FlagD, MaxDistFrom: Integer): Boolean;
var
wTile: TPoint;
t: Integer;
begin
Result := False;
TheTile := RandomizeTile(TheTile, Randomness, Randomness);
wTile := TileToMM(TheTile);
if not rs_OnMiniMap(wTile.X, wTile.Y) then
Exit;
if not DistanceFrom(wTile > MaxDistFrom) then
Exit;
Mouse(wTile.x, wTile.y, 1, 1, true);
Wait(RandomRange(80, 100));
t := getsystemtime;
if (FlagD = 0)then
begin
R_Flag;
end else
R_FFlag(FlagD);
Result := (GetSystemTime - t) < 60000;
end;-Boom