Jump to content

Amulet of Glory Check


Recommended Posts

Posted

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();
}

 

Posted
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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...