September 26, 20169 yr How do you set a break condition? It says Condition cannot be instantiated as an object?
September 26, 20169 yr walkEvent.setBreakCondition(new Condition() { @@Override public boolean evaluate() { return false; //condition to be met here } });
September 26, 20169 yr How do you set a break condition? It says Condition cannot be instantiated as an object? yeah you need to override one of its abstract methods e.g. Condition c = new Condition() { @@Override public boolean evaluate() { return myPosition().getX() >= 9005; } }; WebWalkingEvent w = new WebWalkingEvent(new Position(1, 2, 3); w.setBreakCondition©; or you could just do WebWalkingEvent w = new WebWalkingEvent(new Position(1, 2, 3); w.setBreakCondition(new Condition() { @@Override public boolean evaluate() { return myPosition().getX() >= 9005; } });
September 26, 20169 yr public int onLoop() throws InterruptedException { RS2Object k = getObjects().closest("Tree"); if (!myPlayer().isAnimating()){ k.interact("Chop down"); new ConditionalSleep(2000) { @@Override public boolean condition() throws InterruptedException { return myPlayer().isAnimating(); } }.sleep(); } return 0; }
September 26, 20169 yr walkEvent.setBreakCondition(new Condition() { @[member='Override'] public boolean evaluate() { return false; //condition to be met here } }); lul stealing ballers profile pic
September 26, 20169 yr protected class WebWalk { private WebWalkEvent e = null; private boolean teleports = true; private boolean skills = false; private boolean quests = false; public void allowTeleports(boolean b) { teleports = b; } public void allowSkillLinked(boolean b) { skills = !b; } public void allowQuestLinked(boolean b) { quests = !b; } public void walk(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); profile.checkInventoryForItems(true); e.setPathPreferenceProfile(profile); e.setBreakCondition(new Condition() { @@Override public boolean evaluate() { return false; } }); api.execute(e); } } } Edited September 26, 20169 yr by LoudPacks
September 26, 20169 yr Author Can I just use the evalute event as sort of an update event? To do stuff while walking and return false so it doesn't stop the webwalking?
Create an account or sign in to comment