Infantry001
2008-09-12 15:49:55
In theory, this could walk from Lumbridge to Draynor or Draynor to Falador in one line of code. Of course, Runescape doesn't work that way ;)
Still, this is a very useful function. It works by walking in a straight line to the Tile, even if it's off the minimap!
Soooo? What do you think?
Still, this is a very useful function. It works by walking in a straight line to the Tile, even if it's off the minimap!
{*******************************************************************************
function WalkToTileEx(Tile : TPoint; RandX,RandY,flagdist : integer) : boolean;
By: Infantry001
Description: Walks to tile, even if it is off the minimap!
*******************************************************************************}
function WalkToTileEx(Tile : TPoint; RandX,RandY,flagdist : integer) : boolean;
var
i,temp : TPoint;
mark : integer;
begin
Marktime(Mark);
repeat
i := TileToMM(Tile); //Check for the original tile
result := rs_OnMinimap(i.X,i.Y); //If on minimap, then break
if result then break;
repeat
temp := GetMyPos; //Get tile I'm on
i := Midpoint(Tile,temp); //Find the midpoint
i := TileToMM(i); //If midpoint is on MM, break
if rs_OnMinimap(i.X,i.Y) then break;
until(TimeFromMark(mark) > 10000) //If not, repeat the procedure w/ previous midpoint
Mouse(i.X,i.Y,RandX,RandY,true); //Click the Midpoint - gets closer
FFlag(flagdist); //To original tile
until(TimeFromMark(mark) > 120000)
Mouse(i.X,i.Y,RandX,RandY,true); //Clicks the original tile
FFlag(flagdist);
end;Soooo? What do you think?