Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

WebWalkingEvent.SetBreakCondition?

Featured Replies

How do you set a break condition? It says Condition cannot be instantiated as an object?


walkEvent.setBreakCondition(new Condition() {

@@Override

public boolean evaluate() {

return false; //condition to be met here

}

});

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;

   } 

});


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;

}

walkEvent.setBreakCondition(new Condition() {
            @[member='Override']
            public boolean evaluate() {
                return false; //condition to be met here
            }
        });

lul stealing ballers profile pic  :boge:


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 by LoudPacks

  • 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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.