Banking all except pickaxe using depositbox.

Hi there, i am writing a script that mines iron at the moment. It is mining in rimmington and using the port sarim deposit box to bank the iron. I have noticed a few times now that on the rare occasion it will also bank the pickaxe I am using. Is there a way to avoid this happening? I could code in some function to go to fally and withdraw it again, but if I’m able to just not deposit the pickaxe, that would be great too.

Note: i’m lvl 3 so wielding a mith pickaxe is a no-go.

@Override
public int execute() {
    Log.info("I am in bank.");
    if (DepositBox.open()) {
        Log.info("Banking ore");
        DepositBox.depositAllExcept(Main.pickaxe.getName());
    }
    return Random.nextInt(385, 680);
}

If you only want to keep pickaxe in your inventory you could use Predicate.

private final Predicate<Item> PICKAXE = item -> item.getName().equals("Mithril pickaxe");

@Override
public int execute() {
    Log.info("Bank", "I am in bank.");
    if (DepositBox.open()) {
        Log.info("Bank", "Banking all (except pickaxe)");
        DepositBox.depositAllExcept(PICKAXE);
    }
    return Random.nextInt(385, 680);
}

Fair play, i was trying to keep it in a pickaxe enum, so should i store the item in the enum itself?

bro, item->bank deposit box