Jump to content

Is it possible to disable running when using WebWalkEvent?


Colon Nel

Recommended Posts

 

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
  • Like 1
Link to comment
Share on other sites

  • 2 years later...
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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...