Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Using an inventory item on a fire


    SpareGold
     Share

    Recommended Posts

    I understand how to manipulate inventory items and use them on each other, and I understand most of the interactions with GameObjects, but I cannot figure out how to use an inventory item on a fire. Can anyone explain this to me?

    Link to comment
    Share on other sites

    This should work:

     

     

     

    GameObject fire = getGameObjects().getClosest("Fire");
    if(fire!=null)
    {
    getInventory().getItem("").useOn(fire);
    }

     

    Link to comment
    Share on other sites

    This should work:

     

     

     

    GameObject fire = getGameObjects().getClosest("Fire");

    if(fire!=null)

    {

    getInventory().getItem("").useOn(fire);

    }

     

     

    You should also make sure the Item is != null and that Inventory contains the item. :)

    Link to comment
    Share on other sites

    Okay that's way too easy haha. I've been so used to making Lists and iterators that i forgot there were functions that apply to items like that. Thank you for the reminder!

    Link to comment
    Share on other sites

    You should also make sure the Item is != null and that Inventory contains the item. :)

    True true, Had a few beers last night ;3

    Link to comment
    Share on other sites

     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.