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 Bot fails to run to bank regardless of how I code the logic

Joined
May 7, 2021
Messages
1
Hi guys, final year comp sci here, never worked with Java but thought it was a good time to start.

Anyway my bot has like 16 Class files so its not feasible to post them all here for help.

It is just meant to be a basic wood cutting bot (west varrock oaks and then banking).

Anyway the problem is once the inventory is full, 60%-70% of the time it wont run to the bank and deposit like I have intended. Sometimes it does but most times not (which is already baffling to me). Also I have used the exact same logic for it to run back to the oaks or run from somewhere nearby and that works flawlessly.

What could be the problem here??

Code:
public class TravelToBank extends LeafTask {
    Coordinate pointOne = new Coordinate(3184, 3435, 0);
    Coordinate pointTwo = new Coordinate(3182, 3442, 0);

    Area bankArea = new Area.Rectangular(pointOne, pointTwo);

    @Override
    public void execute() {
        RegionPath regionPath = RegionPath.buildTo(bankArea.getRandomCoordinate());
        if(regionPath != null) {
            regionPath.step();
        }
        else {
            getLogger().warn("regionPath was null in Walk");
        }
    }
}
 
cuppa.drink(java);
Joined
Mar 13, 2018
Messages
7,745
@supadupap00p are you fairly certain this class is causing issue? Eg. if you put a log at the beginning of this class, this class is the one being called?
I'm not sure if I'm missing something, but nothing is jumping out at me as clearly wrong. Do you know if regionPath is null (eg you're getting that warning log) or if regionPath.step() just isn't doing anything?
 
Top