Before 95 Share Posted May 15, 2016 while (!area.contains(getLocalPlayer()) && !area.contains(getWalking().getDestination())) { getWalking().walk(area.getRandomTile()); sleep(2000+Rand.nextInt(1000)); sleepUntil(() -> getLocalPlayer().isStandingStill(), Rand.nextInt(6000)); } Sometimes I'll get this error: [ERROR]15:50:04: Exception has occurred while running! Please report error to developer if problem persists: java.lang.NullPointerException at org.dreambot.api.methods.walking.pathfinding.impl.PathFinder.getNode(PathFinder.java:175) at org.dreambot.api.methods.walking.pathfinding.impl.astar.AStarPathFinder.calculate(AStarPathFinder.java:158) at org.dreambot.api.methods.walking.pathfinding.impl.astar.AStarPathFinder.calculate(AStarPathFinder.java:50) at org.dreambot.api.methods.walking.path.impl.GlobalPath.lambda$updateLocal$6(GlobalPath.java:56) at java.util.Optional.ifPresent(Unknown Source) at org.dreambot.api.methods.walking.path.impl.GlobalPath.updateLocal(GlobalPath.java:48) at org.dreambot.api.methods.walking.path.impl.GlobalPath.walk(GlobalPath.java:37) at org.dreambot.api.methods.walking.impl.Walking.walk(Walking.java:123) at main.Main.onLoop(Main.java:51) at org.dreambot.api.script.AbstractScript.run(AbstractScript.java:223) at java.lang.Thread.run(Unknown Source) Link to comment Share on other sites More sharing options...
darkjack7 4 Share Posted May 16, 2016 idk but you should try something like if(getLocalPlayer().distance(area.getCenterTile() > 15) { // if dist. between player and center of area is greater than 15getWalking().walk(area.getRandomTile()); // then walk to a random tile in the area put a sleep statement here; // sleep to prevent spam clicking } it's dangerous to use a while loop and two sleep statements like you are using Link to comment Share on other sites More sharing options...
Hopewelljnj 46 Share Posted May 16, 2016 Probably a bad tile. They happen sometimes because the ground gets encrypted. I would throw an if around getWalking Link to comment Share on other sites More sharing options...
Diddy 265 Share Posted May 16, 2016 always put your actions in a if statement like if(getWalking().walk(area.getRandomTile())){ sleep(500); } In that way it will only sleep if it succeeded with the action and like hopewell said, sometimes it tries to walk to a title that isn't loaded yet or that the player simply can't reach. so a way to fix that would be to check if it can reach the title with if(getMap().canReach(Tile) && getWalking().walk(Tile){ sleep(5000); } else { // walk to somewhere closer } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.