Adept Posted March 7, 2017 Posted March 7, 2017 How can I drink a potion while webWalking if run energy drops below a certain amount?
GaetanoH Posted March 7, 2017 Posted March 7, 2017 if(getWalking.webWalk(position)){ //Drink potion }
Eagle Scripts Posted March 7, 2017 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
Stimpack Posted March 7, 2017 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
Abuse Posted March 7, 2017 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
Container Posted March 7, 2017 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