March 7, 20178 yr How can I drink a potion while webWalking if run energy drops below a certain amount?
March 7, 20178 yr 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, 20178 yr by Eagle Scripts
March 7, 20178 yr Also note that it's assumed the event has failed if it stops mid-way due to the break condition. Event#hasFailed()
March 7, 20178 yr if (shouldIDrinkPotion()) { drinkPotion(); } final WebWalkEvent webWalkEvent = new WebWalkEvent(destination); webWalkEvent.setBreakCondition(new Condition() { @Override public boolean evaluate() { return shouldIDrinkPotion(); } }); execute(webWalkEvent);
March 7, 20178 yr 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!
Create an account or sign in to comment