There isn't really much going on here, but here are the relevant bits.
This bit is for getting the patches state.
public State getState() {
if (patch == null) {
state = State.NOT_INITIALISED;
} else if (patch.hasAction("Harvest") || patch.hasAction("Pick")) {
state = State.READY_TO_HARVEST;
isFertilised = false;
} else if (patch.hasAction("Clear")) {
state = State.DEAD;
} else if (patch.hasAction("Rake")) {
state = State.OVERGROWN;
} else if (Arrays.stream(patchNames).anyMatch(p -> p.equals(patch.getName()))) {
state = State.EMPTY;
} else {
state = State.GROWING;
}
return state;
}
This bit is responsible for planting the seed, I realise that I could store the state in a variable and not call the function unnecessarily, which I did before and then changed it to this while trying to find this issue, thought maybe that would help.
if (getState() == State.EMPTY) {
inventory.interact("Use", seed);
Sleep.until(() -> inventory.isItemSelected() && inventory.getSelectedItemName().equals(seed), 3000);
patch.interact("Use"); // <----- hos flower patch issue is somewhere here
Sleep.until(() -> getState() == State.GROWING, 10000);
}
Function that initialises the patches from an area.
public void initPatch() {
if (getState() == State.NOT_INITIALISED) {
Filter<RS2Object> filter = new Filter<RS2Object>() {
@Override
public boolean match(RS2Object obj) {
return location.contains(obj) && Arrays.stream(patchIDs).anyMatch(id -> id == obj.getId());
}
};
patch = api.getObjects().closest(filter);
}
}
I am pretty certain that it is not an issue with the initialisation of the patches or getting the wrong state. I logged the patch data in the seed function and its definitely there, not to mention that the bot clears, rakes and picks the limpwurts too, just doesn't plant or use compost.
Any insight would be appreciated!