I have a script that tends to die, and have tried to implement a deathwalking feature where when the bot dies, it teleports using the ring of dueling in its inventory to castle wars. I currently have an if statement at the top of my onloop like so, but when the bot dies/ is started in lumbridge, it just stands there. Any suggestions?
if (deadArea.contains(player)) {
getInventory().interactWithNameThatContains("Castle Wars", "Ring of dueling");
new ConditionalSleep(2000, 4000) {
@Override
public boolean condition() throws InterruptedException {
return player.isAnimating();
}
}.sleep();
return 500;
}