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.

Is it possible to disable running when using WebWalkEvent?

Featured Replies

  • Author

What do you mean with that pseudocode. How can I run code while WebWalking is executing?

I'm not sure of the proper way to do it but you could probably do something like setting energy threshold to 101, which would never be reached so running would never be activated.  Next you could set a break condition for if run is toggled, and then toggle it off elsewhere. :feels: not sure.

If youre not using advanced methods in the event, you could try

walking.webWalk();

I'd assume this sets same defaults as the WebWalkEvent under the hood though. I'd go with setting energy threshold to 101 if the method doesn't clamp it to 1 - 100.

  • Author

 

9 hours ago, apa said:

If youre not using advanced methods in the event, you could try


walking.webWalk();

I'd assume this sets same defaults as the WebWalkEvent under the hood though. I'd go with setting energy threshold to 101 if the method doesn't clamp it to 1 - 100.


I tried setting energy threshold to 101 but it is ignored apparently.

39 minutes ago, Colon Nel said:

 


I tried setting energy threshold to 101 but it is ignored apparently.

It doesn't look like there's an easy way to do this. You could interrupt, disable run, and recall the web-walk, but that won't accomplish anything as it'll just turn run back on, and be slower recalculating the web-walk (if it precomputes), as theres no way to get a path back from the event, only destination point it seems.

An addition to the API for this would be easy enough.

2 hours ago, Colon Nel said:

 


I tried setting energy threshold to 101 but it is ignored apparently.

I just tested w/ the 101 energy threshold and it works for me, perhaps you set it up incorrectly?

This can easily be done but you have to create the webwalk event and pass it to the exector instead of calling the web walking methods inside of the walking class. Just tested this code and it will never run. If you use intellij you can look at the obbed source code of web walking event and see what goes inside to figure these things out quicker.

        Position alkharidBank = new Position(3269, 3167, 0);
        WebWalkEvent webWalkEvent = new WebWalkEvent(varrock);
        webWalkEvent.setEnergyThreshold(Integer.MAX_VALUE);
        this.execute(webWalkEvent).hasFinished();

https://osbot.org/api/org/osbot/rs07/event/WebWalkEvent.html#setEnergyThreshold-int-

 

osbot code that handles runnng in WebWalkEvent

Spoiler

public class WebWalkEvent extends Event {
    public WebWalkEvent(Position... IIIiiiiiIIII) {
        IIIiiiiiIIII.iiiiIiiIIIIi = CoN.IIIiiiiiIIII;
        IIIiiiiiIIII.iIiIiiiIiIII = null;
        IIIiiiiiIIII.iiIiIiiIIIii = null;
        IIIiiiiiIIII.iiiIiiiiiiii = null;
        IIIiiiiiIIII.IiIiiiiIiIii = 1300L;
        IIIiiiiiIIII.IIiiIiiiiiiI = null;
        IIIiiiiiIIII.iiIIiiiiiiiI = -1L;
        IIIiiiiiIIII.IIIIIiiiIIii = 5;
        IIIiiiiiIIII.IiiIIiiiIIIi = 15; // DEFAULT RUN ENERGY SET HERE TO 15
        IIIiiiiiIIII.IiiiiiiiiiIi = true;
        IIIiiiiiIIII.IiIIiiiiIIII = null;
        IIIiiiiiIIII.IIIiiiiiIIII = false;
        IIIiiiiiIIII.IiiiiiiiIIii = 3;
        IIIiiiiiIIII.iIIIiiiIiIII = null;
        IIIiiiiiIIII.iiIiiiiiIIii = IIIiiiiiIIII.IIIiiiiiIIII ? 70 : 20;
        IIIiiiiiIIII.iiiIiiiIIiii = null;
        IIIiiiiiIIII.IIIIIiiiiiIi = false;
        IIIiiiiiIIII.iIiIiiiIiIII = IIIiiiiiIIII;
    }

    public WebWalkEvent setEnergyThreshold(int IIIiiiiiIIII) {
        IIIiiiiiIIII.IiiIIiiiIIIi = IIIiiiiiIIII; // YOU CAN OVERRIDE DEFAULT HERE
        return IIIiiiiiIIII;
    }

    public int execute() throws InterruptedException {
      ...
       if (var16 instanceof ClickMouseEvent && IIIiiiiiIIII.getSettings().getRunEnergy() > IIIiiiiiIIII.IiiIIiiiIIIi) {
          IIIiiiiiIIII.getSettings().setRunning(true); // CHECKS CURRENT ENERGY VS SET ENERGY AND TURNS ON RUN IN THE EXECUTE LOOP
       }
      ...
    }
}

 

 

Edited by battleguard

  • Author

Yup I had a bug in my code where I called execute on the event before setting the energy threshold. If you set energy threshold > 100 it won't toggle run which is what I want.

  • 2 years later...

This doesn't work for me.... When I put in something like this:

WebWalkEvent dungeonWalk = new WebWalkEvent(DUNGEON);
dungeonWalk.setEnergyThreshold(;
;
"In Desired area";

It still enables run somewhere in the middle of the webwalk. Any help would be appreciated. 

 

13 hours ago, Psychotechno said:

This doesn't work for me.... When I put in something like this:


WebWalkEvent dungeonWalk = new WebWalkEvent(DUNGEON);
dungeonWalk.setEnergyThreshold(;
;
"In Desired area";

It still enables run somewhere in the middle of the webwalk. Any help would be appreciated. 

 

Try copying your  code properly. What you have here won't even compile. You were supposed to set energy threshold to something higher than 100 eg. 101

7 hours ago, Jarl said:

Try copying your  code properly. What you have here won't even compile. You were supposed to set energy threshold to something higher than 100 eg. 101

Whooooops, my bad:

WebWalkEvent dungeonWalk = new WebWalkEvent(DUNGEON);
dungeonWalk.setEnergyThreshold(101);
execute(dungeonWalk);

It doesn't turn on run at first, but after two clicks in the minimap it does turn on run again (Even though energy is much lower than 100%, ideally I don't want to turn it on at all during the WebWalk). 

Edited by Psychotechno

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.