My firemaking scripts sporadically walks into the problem where it's having null selected somehow.
i tried resolving this with the following, but this doesn't seem to resolve the issue.
Does anyone know how to prevent this?
if (logAmount >= 1) {
api.inventory.interact("Use", Main.Logs);
if (!api.getInventory().isItemSelected()) {
api.getInventory().deselectItem();
}
api.inventory.interact("Use", "Tinderbox");
}
Would this prevent it maybe?
api.inventory.interact("Use", Main.Logs);
if (api.getInventory().getSelectedItemName() == null) {
api.getInventory().deselectItem();
}
api.inventory.interact("Use", "Tinderbox");