Question Inventory Equip

Discussion in 'Developer Support' started by Who USAF, Dec 22, 2015.

  1. How can I exit an interface that pops up? The bot I wrote is working but there's a few little things I need to add. I've gone with making the bot use the escape button which will hopefully work. Thanks in advance :)

    So many questions.. how do I use Inventory.equip();? It's' asking for "sprites" or something? I don't drink soda.
    I'm trying to equip Bronze Arrows
     
  2. Huh, I never knew there was an equip method, I usually just query for the SpriteItem and interact with it.

    If it's asking for a SpriteItem, that's what the results from the Inventory Queries are, like how the Npc Queries hold Npcs and GameObject queries hold GameObjects.

    So:
    Code (Text):
    1. SpriteItem item = Inventory.newQuery().names("NAME OF ITEM").results().first();
    2. if (item != null)
    3.     Inventory.equip(item);
    Copied/pasted from our conversation, just in case anyone else needed to know the answer.
     
    Reazons and Who USAF like this.

Share This Page

Loading...