Aeglen 328 Share Posted June 1, 2020 Hi, I've been trying to get the walking distance/penalty between a bunch of places (outside of loaded distance, in other floors, etc) but the following method does not work: getWalking().getWebPathFinder().getMovementCost(sx, sy, ex, ey, z); It gives: [ERROR]17:21:14: 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.getMovementCost(PathFinder.java:195) at NWalk.execute(NWalk.java:46) at org.dreambot.api.script.impl.TaskScript.onLoop(TaskScript.java:84) at org.dreambot.api.script.AbstractScript.run(AbstractScript.java:264) at java.lang.Thread.run(Unknown Source) I also find it curious that there are 5 arguments as opposed to 6 (z could be sz and ez) and that it takes ints rather than Tiles. Is there a way to do this without presumably getting the movement paths and iterating through them? Note: (sz, sy, z) and (ex, ey, z) were valid tiles at accessible points on the map when tested. EDIT: Yeah iterating through the movement path works well enough for my purposes. Link to comment Share on other sites More sharing options...
RetroBot 35 Share Posted June 2, 2020 tileOne.distance(tileTwo); Link to comment Share on other sites More sharing options...
Aeglen 328 Author Share Posted June 2, 2020 It's the "walking" distance I'm interested in, not as the crow flies. Iterating through the WebNode path solves this problem well enough. However, it would still be nice to have a way to figure out whether the next step is something like Stairs or just another click on the map. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.