Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script hangs on Inventory interaction when in trade

Featured Replies

I'm having an issue right now, where occasionally when attempting to interact with an Inventory item (to offer), the script will hang. The mouse will move to the inventory item, but it will not right click to interact with it. Usually just pausing and unpausing the script will solve it, and these messages will appear in the log (only after cycling the pause):

[WARN][Bot #1][08/08 03:51:53 AM]: Event executor is taking too long to suspend; terminating now...
[ERROR][Bot #1][08/08 03:51:53 AM]: Caught thread death in EventExecutor

Any ideas?

Edited by bfir3

You can always:

while(object.interact("Action"));

which will just do it untill it works (=returns true)

 

or it will stay stuck in the loop for ever and ever, if you go down this route make sure you add a timeout :p

  • Author

Yeah, I'm not gonna use a while loop like that. Not a good idea.

 

I added additional tracing to my code to hopefully get some more answers. It looks like the interaction fails, but that execution does not continue to the following instruction.

if (!this.getInventory().interact(slotId, "Offer-x"))
{
	this.log("Unable to interact with Inventory item");
}
script.log("Continuing after Inventory interaction attempt");

The next time the issue comes up I will check my log to see what appears. :)

  • Author

To follow up, the issue occurred again today and I checked the log when the mouse was hovering over the inventory item but not interacting with it. Neither of the traces were shown in the log. When I paused the script, the traces both appears shortly after:

[INFO][Bot #1][08/09 08:06:30 PM]: Unable to interact with Offer-X
[INFO][Bot #1][08/09 08:06:30 PM]: Waiting after interaction to offer amount
[INFO][Bot #1][08/09 08:06:30 PM]: Script Fir3 RuneCrafter v1.00 has paused!
[INFO][Bot #1][08/09 08:06:30 PM]: Script Fir3 RuneCrafter v1.00 has resumed!

And then shortly after I saw again:

[WARN][Bot #1][08/09 08:06:34 PM]: Event executor is taking too long to suspend; terminating now...
[WARN][Bot #1][08/09 08:06:46 PM]: Event executor is taking too long to suspend; terminating now...
[ERROR][Bot #1][08/09 08:06:46 PM]: Caught thread death in EventExecutor

When I hit play after pausing the script, it continues fine but usually tries to interact with the inventory item over and over again really quickly (after it was stuck not interacting for a while).

 

Any ideas guys?

 

I often got the same error when hopping worlds. It seems like the event executor can get bugged after a while, causing the script to freeze. What I did is "renewing" the event executor every time before hopping (or in your case, before interacting with an inventory item) like this

try {
	Field field = Bot.class.getDeclaredField("eventExecutor");
	field.setAccessible(true);
	field.set(bot, new EventExecutor(bot));
} catch (Exception e) { }

This completely prevented the error from occuring again for me. I imagine it would fix your problem too.

 

  • Author

I often got the same error when hopping worlds. It seems like the event executor can get bugged after a while, causing the script to freeze. What I did is "renewing" the event executor every time before hopping (or in your case, before interacting with an inventory item) like this

try {
	Field field = Bot.class.getDeclaredField("eventExecutor");
	field.setAccessible(true);
	field.set(bot, new EventExecutor(bot));
} catch (Exception e) { }

This completely prevented the error from occuring again for me. I imagine it would fix your problem too.

 

I may take this approach eventually, but I think my problem is actually related to using an interact action that doesn't exist. I noticed that this error seemed to be occurring when the client would incorrectly report that the player is in a trade (using this.getTrade().isCurrentlyTrading()) and my script would call interact on the desired inventory item with action "Offer-X" when the action does not exist. Instead of failing to interact and continuing as normal, it looks like the interaction method gets completely stuck when the action doesn't exist and locks up further script execution.

 

Does this sound accurate? If so, it may be a change required in the API?

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.