regnivon Posted October 23, 2016 Share Posted October 23, 2016 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; } Quote Link to comment Share on other sites More sharing options...
progamerz Posted October 23, 2016 Share Posted October 23, 2016 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; } check for a message in chatbox which says something like "Oh dear, your dead" or something check it out ur self and if it contains that set a boolean to true and then do the code. Quote Link to comment Share on other sites More sharing options...
Team Cape Posted October 23, 2016 Share Posted October 23, 2016 (edited) 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; } my guess is that when you die, there's a task that gets cut off but lacks a break condition. i've had that happen to me a few times with path walking. the effect of that is that it keeps trying to run the same code and never stops, effectively meaning the script wont utilize anything else. just a shot in the dark, but a possibility nevertheless edit: if i were you, i would test this with logger messages and make the code something like: if (deadArea.contains(player)) { log("confirmed got to this point"); getInventory().interactWithNameThatContains("Castle Wars", "Ring of dueling"); . . . } to make sure that its actually trying to execute that code Edited October 23, 2016 by Imateamcape Quote Link to comment Share on other sites More sharing options...
regnivon Posted October 23, 2016 Author Share Posted October 23, 2016 I figured it out, forgot that the ring of dueling doesn't have a castle wars option when its in your inventory >.> thank you for the debug suggestion though imateamcape that helped me find out the problem! Quote Link to comment Share on other sites More sharing options...
progamerz Posted October 23, 2016 Share Posted October 23, 2016 (edited) I figured it out, forgot that the ring of dueling doesn't have a castle wars option when its in your inventory >.> thank you for the debug suggestion though imateamcape that helped me find out the problem! check for a message in chatbox which says something like "Oh dear, your dead" or something check it out ur self and if it contains that set a boolean to true and then do the code. ^^ use this for better Deathwalk implement a better condition to be used with the dead area. Edited October 23, 2016 by progamerz Quote Link to comment Share on other sites More sharing options...
Trees Posted October 23, 2016 Share Posted October 23, 2016 You can also check when hp == 0 Quote Link to comment Share on other sites More sharing options...
Solzhenitsyn Posted October 23, 2016 Share Posted October 23, 2016 You can also check when hp == 0 Don't do this. Quote Link to comment Share on other sites More sharing options...
Trees Posted October 23, 2016 Share Posted October 23, 2016 Don't do this. It works, or you can check if your player has the death animation (which might be different now because of the grim reaper) Quote Link to comment Share on other sites More sharing options...
Solzhenitsyn Posted October 23, 2016 Share Posted October 23, 2016 It works, or you can check if your player has the death animation (which might be different now because of the grim reaper) Checking if your HP is zero, or if your character has played the death animation works, but you shouldn't do it because it will only work if a conditional check is executed while those conditions are true. If your script is executing instructions in a loop when you die, then the animation will play and your health will be full when your conditional statement runs. Checking to see if you are in the death area is safer, so you shouldn't do either one of those things. 2 Quote Link to comment Share on other sites More sharing options...
progamerz Posted October 23, 2016 Share Posted October 23, 2016 Checking if your HP is zero, or if your character has played the death animation works, but you shouldn't do it because it will only work if a conditional check is executed while those conditions are true. If your script is executing instructions in a loop when you die, then the animation will play and your health will be full when your conditional statement runs. Checking to see if you are in the death area is safer, so you shouldn't do either one of those things. why u guys ignoring the message but yeh its his wish. Quote Link to comment Share on other sites More sharing options...
Solzhenitsyn Posted October 23, 2016 Share Posted October 23, 2016 (edited) why u guys ignoring the message but yeh its his wish. boolean death_flag = false; @[member='Override'] public void onMessage(Message message) { if (message.getMessage().contains("dead") && message.getType().equals(Message.MessageType.GAME)) { log("progamerz raped my butthole :feels:"); death_flag = true; } } my butthole m8 Edited October 23, 2016 by Solzhenitsyn 1 Quote Link to comment Share on other sites More sharing options...
Explv Posted October 23, 2016 Share Posted October 23, 2016 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; } Personally for the sleep I would do something like: new ConditionalSleep(10_000) { @ Override public boolean condition() throws InterruptedException { return !deadArea.contains(myPosition()); } }.sleep(); Quote Link to comment Share on other sites More sharing options...