Jump to content

Amulet of Glory Check


donaldchen34

Recommended Posts

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

 

Link to comment
Share on other sites

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))) {

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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