Welcome!

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

Sign up now!

Question WebPath Stepping

Joined
May 9, 2017
Messages
1
Hi guys, still new to writing these bots.

Recently made a treebot to mine iron ore, and it had been working pretty well. As I use it today though, I notice that WebPath.step() returns false very frequently. Why and when does this happen? I can't seem to find the answer in the Docs. Before today, I didn't have this problem, as it seems to be returning false 90% of the time.

Code:
public class GoMines extends LeafTask{
    private Coordinate iron = new Coordinate( 3175, 3367, 0 );
    private WebPath w = Traversal.getDefaultWeb().getPathBuilder().buildTo(iron);

    @Override
    public void execute() {
        if(w != null){
            if(w.step()){
                System.out.println("Walking towards mines");
                Execution.delay(500);
            }
            else{
                System.out.println("Couldn't walk towards mine");
            }
        }
        else{
            System.out.println("No more steps to mines");
        }
    }
}

Edit: Realized I've posted to the wrong forums, feel free to move/delete.
 
Top