1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bug WebPath getNext() randomly returning null

Discussion in 'Developer Support' started by Alzar12, Sep 12, 2018.

Tags:
  1. Alzar12

    Joined:
    Sep 7, 2018
    Messages:
    1
    Likes Received:
    0
    I recently started creating a bot that simply buys select items at the Varrock General Store and banks them for a cheesy and low cost way of getting some starter cash. However, I am experiencing and issue that involves my path occasionally returning null for seemingly inexplicable reasons. I have been searching around for a solution but if there is already a solution posted somewhere I haven't had any luck finding it. Let me know if I'm doing something wrong.
    Code (Text):
    1. public class GoToBank extends LeafTask {
    2.     private Path path;
    3.     private Coordinate bank = new Coordinate(3183, 3436, 0);
    4.  
    5.     @Override
    6.     public void execute() {
    7.         path = Traversal.getDefaultWeb().getPathBuilder().buildTo(bank);
    8.         if (path != null) {
    9.             path.step();
    10.         }
    11.     }
    12. }
    13.  
     
  2. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Please provide more debug data (start position, if there are any doors that may intervene, the actual contents of the path/getNext when the path is returned non-null which I assume happens since you said it's getNext that's returning null, etc)
     

Share This Page

Loading...