Colon Nel Posted March 16, 2018 Share Posted March 16, 2018 Title Quote Link to comment Share on other sites More sharing options...
Colon Nel Posted March 16, 2018 Author Share Posted March 16, 2018 What do you mean with that pseudocode. How can I run code while WebWalking is executing? Quote Link to comment Share on other sites More sharing options...
TrekToop11 Posted March 17, 2018 Share Posted March 17, 2018 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. not sure. Quote Link to comment Share on other sites More sharing options...
apa Posted March 17, 2018 Share Posted March 17, 2018 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. Quote Link to comment Share on other sites More sharing options...
Colon Nel Posted March 17, 2018 Author Share Posted March 17, 2018 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. Quote Link to comment Share on other sites More sharing options...
apa Posted March 17, 2018 Share Posted March 17, 2018 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. Quote Link to comment Share on other sites More sharing options...
TrekToop11 Posted March 17, 2018 Share Posted March 17, 2018 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? Quote Link to comment Share on other sites More sharing options...
battleguard Posted March 17, 2018 Share Posted March 17, 2018 (edited) 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 March 17, 2018 by battleguard 1 Quote Link to comment Share on other sites More sharing options...
Colon Nel Posted March 17, 2018 Author Share Posted March 17, 2018 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. Quote Link to comment Share on other sites More sharing options...
Psychotechno Posted February 9, 2021 Share Posted February 9, 2021 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. Quote Link to comment Share on other sites More sharing options...
Jarl Posted February 10, 2021 Share Posted February 10, 2021 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 Quote Link to comment Share on other sites More sharing options...
Psychotechno Posted February 10, 2021 Share Posted February 10, 2021 (edited) 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 February 10, 2021 by Psychotechno Quote Link to comment Share on other sites More sharing options...