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 an item in the inventory


    triblion

    Recommended Posts

    Posted

    I am trying to get my script to click an item in my inventory then use it on a game object, I have tried using interact in it's different forms but it will not click it

    Posted

    getInventory().get("Food").useOn(entityNamedHashtag);
    Posted

    is that null safe


    is that null safe

    Posted

    is that null safe

    is that null safe

    Are you null safe? If food  doesn't exist in the inventory then it will NPE

    Posted

    Thanks I will try this when I get back, yeah I check for !=null

    Posted

    Thanks I will try this when I get back, yeah I check for !=null

    you could check for getInventory().contains(food filter) though

    Posted

    you could check for getInventory().contains(food filter) though

    I used contains I just couldn't figure out how to get it to actually select the item, I will try what has been suggested when I get the chance

    Posted
    getInventory().get("Food").useOn(entityNamedHashtag);
    

    GameObject Tree = getGameObjects().closest(GameObject -> GameObject != null && GameObject.getID() == 2092);

    if (Tree != null) {

    getInventory().get("Knife").useOn(2092);

    getInventory().get("Knife").useOn(2091);

     

    I tried this way I also tried getInvetory inside the () and I cannot get it to click on the knife and use it on anything (the thing is a GameObject in this case)

    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.