Jump to content

Client has item Null selected


Recommended Posts

Posted

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");
}

 

https://i.imgur.com/JbG4PMW.png


Would this prevent it maybe?

api.inventory.interact("Use", Main.Logs);

if (api.getInventory().getSelectedItemName() == null) {
    api.getInventory().deselectItem();
}

api.inventory.interact("Use", "Tinderbox");

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...