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

    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?

    Link to comment
    Share on other sites

    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.

    Link to comment
    Share on other sites

    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");

    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.