Adept Posted March 7, 2017 Share Posted March 7, 2017 How can I drink a potion while webWalking if run energy drops below a certain amount? Quote Link to comment Share on other sites More sharing options...
GaetanoH Posted March 7, 2017 Share Posted March 7, 2017 if(getWalking.webWalk(position)){ //Drink potion } Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted March 7, 2017 Share Posted March 7, 2017 (edited) 2 minutes ago, GaetanoH said: if(getWalking.webWalk(position)){ //Drink potion } I think he means that while walking, stop to drink the potion and resume You can do this with a break condition for a WebWalkEvent. Set the breakcondition for when you want it to drink Edited March 7, 2017 by Eagle Scripts 2 Quote Link to comment Share on other sites More sharing options...
Stimpack Posted March 7, 2017 Share Posted March 7, 2017 Also note that it's assumed the event has failed if it stops mid-way due to the break condition. Event#hasFailed() 1 Quote Link to comment Share on other sites More sharing options...
Abuse Posted March 7, 2017 Share Posted March 7, 2017 if (shouldIDrinkPotion()) { drinkPotion(); } final WebWalkEvent webWalkEvent = new WebWalkEvent(destination); webWalkEvent.setBreakCondition(new Condition() { @Override public boolean evaluate() { return shouldIDrinkPotion(); } }); execute(webWalkEvent); 6 Quote Link to comment Share on other sites More sharing options...
Container Posted March 7, 2017 Share Posted March 7, 2017 1 hour ago, Abuse said: if (shouldIDrinkPotion()) { drinkPotion(); } final WebWalkEvent webWalkEvent = new WebWalkEvent(destination); webWalkEvent.setBreakCondition(new Condition() { @Override public boolean evaluate() { return shouldIDrinkPotion(); } }); execute(webWalkEvent); Thanks for the snippet! 1 Quote Link to comment Share on other sites More sharing options...