darkjack7 4 Share Posted April 28, 2016 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 More sharing options...
Diddy 265 Share Posted April 28, 2016 ring = getEquipment().getItemInSlot(9).getName(); Link to comment Share on other sites More sharing options...
Zawy 956 Share Posted April 28, 2016 ring -> ring.getName() !=null && ring.getName().contains("ring of ") !=null try that Link to comment Share on other sites More sharing options...
Glitch 73 Share Posted April 28, 2016 Arent you currently checking if you have a ring equipped and if you do then you're withdrawing another. Link to comment Share on other sites More sharing options...
Hopewelljnj 46 Share Posted April 28, 2016 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.