Trying to make a barbarian power fisher! The bot drops all of the fish but it doesn't try to fish them!
private enum State {
FISH, DROP, WAIT
};
private State getState() {
Entity fishspot = objects.closest("Fishing spot");
if (!inventory.isEmptyExcept("Feather","Barbarian rod"))
return State.DROP;
if (fishspot != null)
return State.FISH;
return State.WAIT;
}
@Override
public int onLoop() throws InterruptedException {
switch (getState()) {
case FISH:
Entity fishspot = objects.closest("Fishing spot");
if (fishspot != null) {
fishspot.interact("Use-rod");
}
break;
case DROP:
inventory.dropAll("Leaping trout","Leaping salmon","Leaping sturgeon");
break;
case WAIT:
sleep(random(500, 700));
break;
}
return random(200, 300);
}