Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Bug WebPath getNext() randomly returning null

Joined
Sep 7, 2018
Messages
1
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:
public class GoToBank extends LeafTask {
    private Path path;
    private Coordinate bank = new Coordinate(3183, 3436, 0);

    @Override
    public void execute() {
        path = Traversal.getDefaultWeb().getPathBuilder().buildTo(bank);
        if (path != null) {
            path.step();
        }
    }
}
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
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)
 
Top