Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Bug Inventory SpriteItems Don't have "Use" Option in "getInventoryActions"

Joined
Aug 23, 2015
Messages
1,961
Gamemode: Osrs
Repeatability: 100%
Description: No "Use" option in inventory actions list

Code:
Code:
SpriteItem ok = Inventory.newQuery().names("Coins").results().first();
        SpriteItem ok0 = Inventory.newQuery().names("Potato with cheese").results().first();
        SpriteItem mithItem = Inventory.newQuery().names("Mithril full helm").results().first();
        if(mithItem != null){
            System.out.println(mithItem.getDefinition().getName());
            System.out.println(mithItem.getDefinition().getInventoryActions());
        }
        if(ok != null){
            System.out.println(ok.getDefinition().getName());
            System.out.println(ok.getDefinition().getInventoryActions());
        }
        if(ok0 != null){
            System.out.println(ok0.getDefinition().getName());
            System.out.println(ok0.getDefinition().getInventoryActions());
        }

Output:
Mithril full helm
[Wear, Drop]
Coins
[Drop]
Potato with cheese
[Eat, Drop]


From my very brief testing, it seemed that the code "spriteItem.interact("Use", Inventory.getSelectedItem() + " -> " + GameObject);" will just hover the item in the inventory, but using the code spriteItem.interact("Use") does eventually manage to use the item.
 
Last edited:
Joined
Jun 20, 2015
Messages
161
This seems to be affecting fletching and cooking bots, preventing either from working properly. Whenever they need to use an item on another item (knife on log/fish on range) they highlight the first item but don't use it on the second.
 
Joined
Dec 10, 2014
Messages
3,255
Have you tested what "spriteItem.interact("Use", Inventory.getSelectedItem() + " -> " + GameObject);" would actually be? Unless by GameObject you mean the gameobject's name?

Rs3 doesn't have the "Use" action either, yet it's possible to use the items on each other by using item.interact("Use")
 
Joined
Aug 23, 2015
Messages
1,961
Have you tested what "spriteItem.interact("Use", Inventory.getSelectedItem() + " -> " + GameObject);" would actually be? Unless by GameObject you mean the gameobject's name?

Rs3 doesn't have the "Use" action either, yet it's possible to use the items on each other by using item.interact("Use")

The code I was using is like this:
Spriteitem whatever = Spriteitem.newQuery.names("Coins").results.nearest;
GameObject range = GameObjects.newQuery.names("Range").results.nearest;
whatever.interact("Use", Inventory.getSelectedItem() + " -> " + range);

I don't know what you mean by testing what it would actually be.

I just switched to doing this, and it's working:
Code:
whatever.interact("Use");
if(Inventory.getSelectedItem() != null && Inventory.getSelectedItem().getDefinition().getName().contains("Coins")){
                range.interact("Use");
 
@Aidden This is probably the issue preventing your fletcher from working.
 
@SlashnHax this issue seems to extend to using one spriteitem on another
 
Joined
Dec 10, 2014
Messages
3,255
The code I was using is like this:
Spriteitem whatever = Spriteitem.newQuery.names("Coins").results.nearest;
GameObject range = GameObjects.newQuery.names("Range").results.nearest;
whatever.interact("Use", Inventory.getSelectedItem() + " -> " + range);

I don't know what you mean by testing what it would actually be.

I just switched to doing this, and it's working:
Code:
whatever.interact("Use");
if(Inventory.getSelectedItem() != null && Inventory.getSelectedItem().getDefinition().getName().contains("Coins")){
                range.interact("Use");
 
@Aidden This is probably the issue preventing your fletcher from working.
 
@SlashnHax this issue seems to extend to using one spriteitem on another
output
Code:
Inventory.getSelectedItem() + " -> " + range
It won't be "selectedItem -> Range"
 
Joined
Sep 25, 2016
Messages
8
The below has worked for me in the past, not sure if this will help you.

Java:
return gameObject.interact("Use", item.getDefinition().getName() + " -> " + objectName);
 
Top