Sir R. M8gic1an
2009-05-16 15:08:28
Function NextTileIndex(Path: TPointArray): Integer;
var
TP: TPoint;
i : integer;
begin
TP := NearestTile(Path, 0);
for i:= 0 to High(Path) do
if (TP.x = Path[i].x)and(TP.y = Path[i].y) then break;
if i > High(Path) then
begin
Result := 0;
exit;
end;
Result := i;
end;
Function PickUpPath(Path: TPointArray; FlagD: integer): boolean;
var i: integer;
begin
Result := True;
for i:= NextTileIndex(Path) to High(Path) do
begin
if TileOnMM(Path[i]) then
if not WalkToTile(Path[i], 1, 0) then
Result := false
else begin
FFlag(FlagD);
wait(200+Random(500))
end
else Result := false;
if not Result then exit;
end;
end;
very simple, NextTileIndex will return the number of the array of the walk path which is closest to you.
PickUpPath will use NextTileIndex for you to be able to start from anywhere close to the path. This is very good for when you log out, or something like that.
~RM