}
if (interfaces.get(INTERFACE_COFFIN).isValid()) {
atCloseInterface(INTERFACE_COFFIN, INTERFACE_COFFIN_CLOSE);
sleep(500, 800);
}
RSNPC theNPC;
if ((theNPC = npcs.getNearest(NPC_NAME)) == null) {
return -1;
}
if (inventory.getCountExcept(GraveDigger.COFFINS) > 23) {
if (interfaces.canContinue()) {
interfaces.clickContinue();
sleep(1500, 2000);
}
final RSObject depo = objects.getNearest(12731);
if (depo != null) {
if (!calc.tileOnScreen(depo.getLocation())) {
walking.getPath(depo.getLocation()).traverse();
camera.turnTo(depo);
} else {
depo.interact("Deposit");
}
}
if (interfaces.get(Bank.INTERFACE_DEPOSIT_BOX).isValid()) {
for (int i = 27; i > 23; i--) {
interfaces.get(11).getComponent(17).getComponent(i).interact("Deposit-All");
sleep(900, 1200);
}
interfaces.getComponent(11, 15).doClick();
return random(500, 700);
}
return random(2000, 3000);
}
if (interfaces.get(236).isValid()) {
if (interfaces.getComponent(236, 2).getText().trim().contains("know")) {
interfaces.getComponent(236, 2).doClick();
} else {
interfaces.getComponent(236, 1).doClick();
}
}
if (interfaces.canContinue()) {
final String text = interfaces.getComponent(242, 4).getText().toLowerCase().trim();
interfaces.clickContinue();
if (text.contains("empty") || text.contains("not")) {
removedGraves = false;
talkToNPC = false;
for (final Coffin coffin : coffins) {//Rinse and reuse data.
coffin.setCoffinID(-1);
coffin.setStoneID(-1);
coffin.set = false;
}
}
return random(500, 1200);
}
if (talkToNPC) {
getNPCInView(theNPC);
return theNPC.interact("Talk-to") ? random(800, 2000) : 0;
}
if (interfaces.get(220).isValid()) {
return atCloseInterface(220, 16) ? random(500, 800) : 0;
}
if (getMyPlayer().isMoving() || getMyPlayer().getAnimation() != -1) {