November 9, 20187 yr Not sure if this works for a amulet of glory check as it was working earlier but for some reason isnt now. Spoiler public final String[] amuletOfGlory = {"Amulet of glory(6)", "Amulet of glory(5)", "Amulet of glory(4)", "Amulet of glory(3)", "Amulet of glory(2)", "Amulet of glory(1)" }; public void checkGlory() throws InterruptedException { if (!getEquipment().isWearingItem(EquipmentSlot.AMULET, String.valueOf(amuletOfGlory))) { if (getEquipment().isWearingItem(EquipmentSlot.AMULET)) { getEquipment().unequip(EquipmentSlot.AMULET); } else { if (!getInventory().contains("Amulet of glory(6)")) { if (!getBank().isOpen()) { bank(); getBank().withdraw("Amulet of glory(6)", 1); getBank().close(); } } else { getInventory().interact("Wear", "Amulet of glory(6)"); } } } else { bank(); } } private void bank() throws InterruptedException { getBank().open(); getBank().depositAll(); }
November 10, 20187 yr Author 38 minutes ago, Juggles said: Use a lambda expression instead. I use the string in a different class too should i change both of them to lamdas does the expression not work with the string Edited November 10, 20187 yr by donaldchen34
November 10, 20187 yr 11 minutes ago, donaldchen34 said: I use the string in a different class too should i change both of them to lamdas does the expression not work with the string I would just do !getEquipment().contains(f->f.getName.contains("Amulet of glory(") {
November 10, 20187 yr Author 9 minutes ago, Juggles said: I would just do !getEquipment().contains(f->f.getName.contains("Amulet of glory(") { Didnt even think about including the ( after the glory
November 12, 20187 yr On 11/10/2018 at 12:01 AM, donaldchen34 said: Not sure if this works for a amulet of glory check as it was working earlier but for some reason isnt now. Hide contents public final String[] amuletOfGlory = {"Amulet of glory(6)", "Amulet of glory(5)", "Amulet of glory(4)", "Amulet of glory(3)", "Amulet of glory(2)", "Amulet of glory(1)" }; public void checkGlory() throws InterruptedException { if (!getEquipment().isWearingItem(EquipmentSlot.AMULET, String.valueOf(amuletOfGlory))) { if (getEquipment().isWearingItem(EquipmentSlot.AMULET)) { getEquipment().unequip(EquipmentSlot.AMULET); } else { if (!getInventory().contains("Amulet of glory(6)")) { if (!getBank().isOpen()) { bank(); getBank().withdraw("Amulet of glory(6)", 1); getBank().close(); } } else { getInventory().interact("Wear", "Amulet of glory(6)"); } } } else { bank(); } } private void bank() throws InterruptedException { getBank().open(); getBank().depositAll(); } String.valueOf(amuletOfGlory) ^ This does not do what you seem to think it does Instead, do: if (!getEquipment().isWearingItemThatContains(EquipmentSlot.AMULET, amuletOfGlory))) {
Create an account or sign in to comment