1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Developer Support' started by Snufalufugus, Mar 3, 2017.

  1. Snufalufugus

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

    Code:
    Code (Text):
    1. SpriteItem ok = Inventory.newQuery().names("Coins").results().first();
    2.         SpriteItem ok0 = Inventory.newQuery().names("Potato with cheese").results().first();
    3.         SpriteItem mithItem = Inventory.newQuery().names("Mithril full helm").results().first();
    4.         if(mithItem != null){
    5.             System.out.println(mithItem.getDefinition().getName());
    6.             System.out.println(mithItem.getDefinition().getInventoryActions());
    7.         }
    8.         if(ok != null){
    9.             System.out.println(ok.getDefinition().getName());
    10.             System.out.println(ok.getDefinition().getInventoryActions());
    11.         }
    12.         if(ok0 != null){
    13.             System.out.println(ok0.getDefinition().getName());
    14.             System.out.println(ok0.getDefinition().getInventoryActions());
    15.         }
    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.
     
    #1 Snufalufugus, Mar 3, 2017
    Last edited: Mar 3, 2017
  2. Infinite Monkeys

    Joined:
    Jun 20, 2015
    Messages:
    159
    Likes Received:
    48
    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.
     
  3. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,212
    Likes Received:
    1,042
    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")
     
  4. Snufalufugus

    Joined:
    Aug 23, 2015
    Messages:
    1,961
    Likes Received:
    757
    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 (Text):
    1. whatever.interact("Use");
    2. if(Inventory.getSelectedItem() != null && Inventory.getSelectedItem().getDefinition().getName().contains("Coins")){
    3.                 range.interact("Use");
    --- Double Post Merged, Mar 4, 2017, Original Post Date: Mar 4, 2017 ---
    @Aidden This is probably the issue preventing your fletcher from working.
    --- Double Post Merged, Mar 4, 2017 ---
    @SlashnHax this issue seems to extend to using one spriteitem on another
     
  5. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,212
    Likes Received:
    1,042
    output
    Code (Text):
    1. Inventory.getSelectedItem() + " -> " + range
    It won't be "selectedItem -> Range"
     
  6. Greg

    Joined:
    Sep 25, 2016
    Messages:
    8
    Likes Received:
    2
    The below has worked for me in the past, not sure if this will help you.

    Code (Java):
    1.  
    2. return gameObject.interact("Use", item.getDefinition().getName() + " -> " + objectName);
    3.  
     
  7. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,600
    Likes Received:
    990
    I was using item1.interact("Use") and then item2.interact("Use") and that was working prior to the osrs update. Doesn't work anymore though apparently. Will debug shortly
     

Share This Page

Loading...