Jump to content

Client has item Null selected


Maxo

Recommended Posts

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");
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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