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
  • Use Item on NPC


    Juggles

    Recommended Posts

    Posted

    How would I go about doing this?

    I have (getNPC).closest("Name").interact("Use")

     

    but im not sure how to select the item first. 

    Posted

    To select the item, do getInventory().interact("Item name");

    Posted

    To select the item, do getInventory().interact("Item name");

    Thank you! 

    Posted

    Hey, I believe there is method called useOn(entity) in the inventory class.

    Posted

    Whole script is coded, just need this last part still

    getInventory().getItemInSlot(2).useOn("NPC");

     

    I thought this would select the item in the second slot and use it on the NPC but that doesnt work. 

    Am I doing it incorrectly?

    Posted

    Whole script is coded, just need this last part still

    getInventory().getItemInSlot(2).useOn("NPC");

     

    I thought this would select the item in the second slot and use it on the NPC but that doesnt work. 

    Am I doing it incorrectly?

    That is technically the 3rd slot of the inventory, as the inventory is an array. This means the first slot is 0 and the last is 27.

    Posted

    That is technically the 3rd slot of the inventory, as the inventory is an array. This means the first slot is 0 and the last is 27.

    or in other terms getInventory().getItemInSlot(1).useOn("NPC");

    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.