Jump to content

Error when interacting with item in inventory


Loki874

Recommended Posts

Hi, I have the following piece of code:

inventory.getItem("Tuna").interact("Eat")

and sometimes the bot hangs up for a few seconds (looks like 7 seconds) and displays the following error into the logger:

[ERROR][Bot #1][08/16 08:43:25 AM]: Inventory widget is null, trying to guess position.

This is causing the bot to sometimes die as he does not eat on time. Any suggestions?

EDIT: I could confirm there are still Tunas left in the inventory 

Edited by Loki874
Link to comment
Share on other sites

3 hours ago, Loki874 said:

Hi, I have the following piece of code:


inventory.getItem("Tuna").interact("Eat")

and sometimes the bot hangs up for a few seconds (looks like 7 seconds) and displays the following error into the logger:


[ERROR][Bot #1][08/16 08:43:25 AM]: Inventory widget is null, trying to guess position.

This is causing the bot to sometimes die as he does not eat on time. Any suggestions?

EDIT: I could confirm there are still Tunas left in the inventory 

Open the inventory before trying to eat :)

Link to comment
Share on other sites

17 minutes ago, Loki874 said:

FIXED

Looks like it was happening occasionally when the inventory tab wasn't available (like when the bank interface is open)


if(tabs.getTabWidget(Tab.INVENTORY) != null && !Tab.INVENTORY.isDisabled(bot)) {
	inventory.getItem("Tuna").interact("Eat")
}

 

Download the dev build 2.5.55  It can now tell where items are in inventory without it being open according to Patrick's change log.

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...