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
  • Using an inventory item on a fire


    SpareGold

    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • 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.