Malcolm Posted December 15, 2018 Posted December 15, 2018 Am I not able to use any sort of NPC as a break condition? I've been having a problem getting this to work. Maybe I'm just being a dummy xD walkEvent.setBreakCondition(new Condition() { @Override public boolean evaluate() { return mage != null && mage.isVisible(); } });
Juggles Posted December 15, 2018 Posted December 15, 2018 How long are you waiting? Break condition hasn't a built in sleep timer of like 10-20 seconds you have to wait to activate. Why? I don't know. Your condition should return true if the dude is visible. REad this thread for More info and ways around it.
Malcolm Posted December 15, 2018 Author Posted December 15, 2018 15 minutes ago, Juggles said: How long are you waiting? Break condition hasn't a built in sleep timer of like 10-20 seconds you have to wait to activate. Why? I don't know. Your condition should return true if the dude is visible. REad this thread for More info and ways around it. Yeah I'm not waiting that long. I'll have to see what I can do to actually have that going for that long.
jca Posted December 15, 2018 Posted December 15, 2018 (edited) 5 minutes ago, Malcolm said: Yeah I'm not waiting that long. I'll have to see what I can do to actually have that going for that long. Is the NPC mage already set by the time you reach the condition? In the Boolean function call NPC mage = getNpcs().closest(“mage”); before returning. That may help... Edited December 15, 2018 by jca
Tom Posted December 15, 2018 Posted December 15, 2018 Alternatively you could set the WebWalkEvent to be asynchronous #setAsync() And then make an infinite loop checking the condition on the main thread. Web Walker has proven to be inconsistent at times
Malcolm Posted December 15, 2018 Author Posted December 15, 2018 Thanks everyone, you're actually all the best. Very helpful again