Waffe Posted June 25, 2016 Posted June 25, 2016 I'm unable to import this, am i doing something wrong? I think i need to use this for webwalkevent, Can someone please teach me how to import this. Thanks
Waffe Posted June 25, 2016 Author Posted June 25, 2016 Why do you need this for webwalkevent? I need it to set a break condition so i can exit out of my webwalk, to make it less bot like i guess. Any ideas how? Such as webwalk(bank) if bank.isVisible interact with bank.
Token Posted June 25, 2016 Posted June 25, 2016 I need it to set a break condition so i can exit out of my webwalk, to make it less bot like i guess. Any ideas how? Such as webwalk(bank) if bank.isVisible interact with bank. Yes, you don't need the inoderoutefinder to set a break condition, all you have to use is the setbreakcondition method
Waffe Posted June 25, 2016 Author Posted June 25, 2016 Yes, you don't need the inoderoutefinder to set a break condition, all you have to use is the setbreakcondition method Any example snippets u can give me?
Token Posted June 25, 2016 Posted June 25, 2016 Any example snippets u can give me? Look at the api docs, it's quite a simple method 1
LoudPacks Posted June 25, 2016 Posted June 25, 2016 (edited) protected abstract static class WebWalk { private static WebWalkEvent e = null; private static boolean teleports = true; private static boolean skills = false; private static boolean quests = false; public static void allowTeleports(boolean b) { teleports = b; } public static void allowSkillLinked(boolean b) { skills = !b; } public static void allowQuestLinked(boolean b) { quests = !b; } public static void walk(Area bounds, Area walkArea, int thresh) { if (e == null || e.hasFailed() || e.hasFinished()) { e = new WebWalkEvent(walkArea); PathPreferenceProfile profile = new PathPreferenceProfile(); profile.setAllowTeleports(teleports); profile.ignoreAllSkillLinks(skills); profile.ignoreAllQuestLinks(quests); e.setPathPreferenceProfile(profile); e.setBreakCondition(new Condition() { @Override public boolean evaluate() { if (bounds.contains(s.myPlayer().getPosition()) && s.myPlayer().getPosition().distance(e.getDestination()) <= thresh) { return true; } return false; } }); s.execute(e); } } public static void walk(Position pos) { if (e == null || e.hasFailed() || e.hasFinished()) { e = new WebWalkEvent(pos); PathPreferenceProfile profile = new PathPreferenceProfile(); profile.setAllowTeleports(teleports); profile.ignoreAllSkillLinks(skills); profile.ignoreAllQuestLinks(quests); e.setPathPreferenceProfile(profile); e.setBreakCondition(new Condition() { @Override public boolean evaluate() { if (s.myPlayer().getPosition().equals(pos)) { return true; } return false; } }); s.execute(e); } } } I have static instances like this for various classes and helper methods so then I can just do WebWalk.walk(area, area, int); You can make them nonstatic / protected / abstract but I have this in an abstract class that all my tasks extend Edited June 25, 2016 by LoudPacks 1