Welcome!

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

Sign up now!

WebWalking some how stops.

Joined
Jan 8, 2015
Messages
1,427
The code I used is the following;

Java:
public static boolean walkToArea(final Area area) {
    final Coordinate destination = area.getRandomCoordinate();
    final WebPath path = Traversal.getDefaultWeb().getPathBuilder().buildTo(destination);
    return path != null && path.step(true);
}

Java:
@Override
public boolean validate() {
    return Inventory.isFull() || Inventory.isEmpty();
}

@Override
public void execute() {
    if (Methods.atBank()) {
        if (Inventory.isFull()) {
            if (!Bank.isOpen()) {
                Bank.open();
            } else {
                clickDepositAllButton();
            }
        } else {
            if (Bank.isOpen()) {
                Bank.close();
            } else {
                walkToMiningSpot();
            }
        }
    } else if (Methods.atMiningSpot()) {
        if (Inventory.isFull()) {
            walkToBank();
        }
    } else {
        if (Inventory.isFull()) {
            walkToBank();
        } else {
            walkToMiningSpot();
        }
    }
}

private boolean clickDepositAllButton() {
    InterfaceComponent button = Interfaces.getAt(12, 25);

    if (button != null) {
        if (button.isValid() && button.isVisible()) {
            LazyAIOMiner.status = "Depositing items";
            if (button.click()) {
                Execution.delayUntil(() - > Inventory.isEmpty(), 1000, 1500);
                return true;
            }
        }
    }
    return false;
}

private boolean walkToBank() {
    LazyAIOMiner.status = "Walking to bank";
    return Methods.walkToArea(LazyAIOMiner.bankArea);

    /*Coordinate location = LazyAIOMiner.bankArea.getRandomCoordinate();
        WebPath bankPath = Traversal.getDefaultWeb().getPathBuilder().buildTo(location);

        if (bankPath != null) {
            LazyAIOMiner.status = "Walking to bank";
            return bankPath.step();
        }

        return false;*/
}

private boolean walkToMiningSpot() {
    LazyAIOMiner.status = "Walking to mining spot";
    return Methods.walkToArea(LazyAIOMiner.mineArea);

    /*Coordinate location = LazyAIOMiner.mineArea.getRandomCoordinate();
        WebPath minePath = Traversal.getDefaultWeb().getPathBuilder().buildTo(location);

        if (minePath != null) {
            LazyAIOMiner.status = "Walking to mining spot";
            return minePath.step();
        }

        return false;*/
}

Any ideas where it can go wrong?

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
 
Joined
Dec 10, 2014
Messages
3,255
What was the bug in the video? It seemed to walk to the bank fine, and it ended too quick for me to actually see what happened when walking to the mine :/
 
Joined
Jan 8, 2015
Messages
1,427
What was the bug in the video? It seemed to walk to the bank fine, and it ended too quick for me to actually see what happened when walking to the mine :/

That's where the script stopped walking. It will just stand there and not walk to the mine :(
 
Joined
Jan 8, 2015
Messages
1,427
It's possible that he codes by breaking every action into a method stub, creates the logic flow, then fills the stubs afterwards.

Yep, that's how I usually code it, though the clickDepositButton was done by hand because I did not know there already was one.
 
Top