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
  • Help detecting whether I am wearing an equipment


    darkjack7

    Recommended Posts

    i'm trying to make my script detect whether i have a ring of dueling on so i have tried this  placed in the middle of a banking snippet

     

    if(getEquipment().contains(ring -> ring.getName().contains("dueling")))
    {
    getBank().withdraw("Ring of dueling(8)");
    }
     
    am i doing something wrong? thanks
     
    edit: it is withdrdawing the ring of dueling(8) but the problem is that i already had a ring of dueling(6) equiped
    Link to comment
    Share on other sites

    Arent you currently checking if you have a ring equipped and if you do then you're withdrawing another.

    He's right.

    You need to put a ! in front of getEquipment() so it returns true only if one is not equipped.

       v
    if(!getEquipment().contains(ring -> ring.getName().contains("dueling")))
    {
    getBank().withdraw("Ring of dueling(8)");
    }
    
    
    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.