private void wealth() {
if (!getEquipment().isWearingItem(EquipmentSlot.RING, "Ring of wealth") && getEquipment().interact(EquipmentSlot.RING, "Grand exchange")) {
Position current = myPlayer().getPosition();
new ConditionalSleep(1500, 2000) {
@Override
public boolean condition() {
return !myPlayer().getPosition().equals(current);
}
}.sleep();
} else {
for (Item item : getInventory().getItems()) {
if (item != null && item.getName().contains("wealth") && item.getName().matches(".*\\d+.*")) {
item.interact("wear");
new ConditionalSleep(1500, 2000) {
@Override
public boolean condition() {
return getEquipment().isWearingItem(EquipmentSlot.RING, item.getId());
}
}.sleep();
break;
}
}
}
}
!getEquipment().isWearingItem(EquipmentSlot.RING, "Ring of wealth")
This ensures the script doesn't attempt to teleport with a ring that has no charges. Probably isn't necessary, however nice code man!