Since I'm getting pretty tired of people making pre-set paths I'd port overflow's pathfinder to OSBot.
When you have to walk a large distance you could use this code down here instead of using pre-set paths.
import nl.psvxe.scripts.pathfinder.core.util.Structure;
import nl.psvxe.scripts.pathfinder.core.wrapper.TilePath;
import nl.psvxe.scripts.pathfinder.impl.Pathfinder;
private Position[] currentPath;
path = pf.findPath(Structure.TILE.getHash(ctx.myPosition().getX(), ctx.myPosition().getY(), ctx.myPosition().getZ()),Structure.TILE.getHash(x, y, z), 500, false);
if(path == null){
ctx.localWalker.walk(new Position(ctx.myPosition().getX()+3, ctx.myPosition().getY()+2,0));
return;
}
currentPath = new Position[path.size()];
for (int i = 0; i < path.size(); i++) {
currentPath[i] = getTile(path.get(i).getHash());
}
ctx.localWalker.walkPath(currentPath);
private Position getTile(int hash) {
return new Position(Structure.TILE.getX(hash),
Structure.TILE.getY(hash), Structure.TILE.getZ(hash));
}
Sometimes it can get stuck if get into a new region. To fix this you've to add Dynamicsleep and return if it isn't moving.
if(ctx.localWalker.walkPath(currentPath)){
new DynamicSleep(int0, int1){
@Override
public boolean breakCondition() {
return !ctx.myPlayer().isMoving();
}
}.sleep();
}Download the jar and import it into your libary: https://www.dropbox.com/s/lskdq1s4hiykyec/Pathfinder.jar?dl=0
Thanks overflow for the code! https://github.com/Overflow-p****bot/Pathfinder
Thanks Erke for helping me out with a few things
To make the paths more randomized you could add this within the code too: http://osbot.org/forum/topic/71632-getrandomizedpathposition-int-getlocalpathposition-position/