Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Get distance between 2 arbitrary tiles


    Aeglen

    Recommended Posts

    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

    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.