monkeyez 6 Posted August 11, 2018 if (getInventory().slotContains(27,"Maple longbow (u)")) { sleep(Calculations.random(1500,25000)); getBank().openClosest(); } This code seems to ignore the if statement and instead it consistently opens the bank. help
Nucleus 3 Posted August 14, 2018 Try using a Filter instead of passing a String: if (getInventory().slotContains(27, item -> item.getName().endsWith("(u)"))){ If that doesn't work then you can try another method of checking if your inventory is full of unstrung maple longbows: final String UNSTRUNG_LONGBOW = "Maple longbow (u)"; if(getInventory().isFull() && getInventory().onlyContains(item -> item.getName().contains(UNSTRUNG_LONGBOW))){ Just a side note, you can use the method sleepUntil() to have your script sleep until the bank window is opened: sleepUntil(() -> getBank.isOpen(), 2000);
Recommended Posts
Archived
This topic is now archived and is closed to further replies.