Paradox68 Posted January 10, 2016 Share Posted January 10, 2016 (edited) Once the webwalk is called, that's all the bot will focus on until the task is complete, but it doesn't handle al-kharid gate and I need a way to interrupt it mid event and interact with the gate: if (!getArea(location).contains(myPlayer())) { getWalking().webWalk(getArea(location).getRandomPosition()); RS2Object gate = getObjects().closest("Gate"); if (gate != null) { if (gate.hasAction("Pay-toll(10gp)")) { gate.interact("Pay-toll(10gp)"); } } } I also tried placing the gate interaction before the walk event but obviously that still doesn't work. Edited January 10, 2016 by Paradox68 Quote Link to comment Share on other sites More sharing options...
Final Calibur Posted January 10, 2016 Share Posted January 10, 2016 (edited) I don't know a lick of this API, as I'm a scripter from a different botting site. However after glancing at the API, I'm assuming you use the setBreakCondition method in the WebWalkEvent class. In this way you specify a condition for the walking event to break for. Edited January 10, 2016 by Final Calibur 3 Quote Link to comment Share on other sites More sharing options...
Joseph Posted January 10, 2016 Share Posted January 10, 2016 That should work. If not you might be able to use event executor and there is an interrupt method Quote Link to comment Share on other sites More sharing options...
Paradox68 Posted January 10, 2016 Author Share Posted January 10, 2016 I know i'm dumb but I'm still learning. Can you tell me why this won't work? http://pastebin.com/DgwrniXk Quote Link to comment Share on other sites More sharing options...
Paradox68 Posted January 10, 2016 Author Share Posted January 10, 2016 That should work. If not you might be able to use event executor and there is an interrupt method Quote Link to comment Share on other sites More sharing options...
Chicken Wing Posted January 10, 2016 Share Posted January 10, 2016 (edited) Walk via making a WebWalkEvent object, and use the method setBreakCondition(Condition breakCondition), then execute the event. You need to make a Condition object that has the condition where you want the event to terminate. Example: Condition condition = new Condition() { @Override public boolean evaluate() { return getBank().isOpen(); } }; Edited January 10, 2016 by Chicken Wing Quote Link to comment Share on other sites More sharing options...
FrostBug Posted January 10, 2016 Share Posted January 10, 2016 (edited) I know i'm dumb but I'm still learning. Can you tell me why this won't work? http://pastebin.com/DgwrniXk The reasons this doesn't work are too many to list. Don't create your own webwalker, use the one osbot has made for you. INodeRouteFinder nodeFinder = INodeRouteFinder.createSimple(); WebWalkEvent evt = new WebWalkEvent(nodeFinder, position); evt.setBreakCondition(new Condition() { @Override public boolean evaluate() { return getObjects().closest("Gate") != null; } }); execute(evt); In addition to this however, you also need to check that you're on the wrong side of the gate. Otherwise it's gonna keep breaking and going thru the gate even after passing it. Edited January 10, 2016 by FrostBug 1 Quote Link to comment Share on other sites More sharing options...
Paradox68 Posted January 10, 2016 Author Share Posted January 10, 2016 The reasons this doesn't work are too many to list. Don't create your own webwalker, use the one osbot has made for you. INodeRouteFinder nodeFinder = INodeRouteFinder.createSimple(); WebWalkEvent evt = new WebWalkEvent(nodeFinder, position); evt.setBreakCondition(new Condition() { @Override public boolean evaluate() { return getObjects().closest("Gate") != null; } }); execute(evt); In addition to this however, you also need to check that you're on the wrong side of the gate. Otherwise it's gonna keep breaking and going thru the gate even after passing it. Quote Link to comment Share on other sites More sharing options...
Joseph Posted January 10, 2016 Share Posted January 10, 2016 On the real though don't make a WWE use the osbot one. If you confused about anything the bug said lmk I'll try my best to explain it. But follow the bugs suggestion please Quote Link to comment Share on other sites More sharing options...
Paradox68 Posted January 10, 2016 Author Share Posted January 10, 2016 On the real though don't make a WWE use the osbot one. If you confused about anything the bug said lmk I'll try my best to explain it. But follow the bugs suggestion please I am a little confused. Do you think you could spare a minute on Teamviewer to let me know what creating your own WebWalkEvent consists of? Quote Link to comment Share on other sites More sharing options...
Chicken Wing Posted January 10, 2016 Share Posted January 10, 2016 Don't create your own webwalker, use the one osbot has made for you. On the real though don't make a WWE use the osbot one. I am a little confused. Do you think you could spare a minute on Teamviewer to let me know what creating your own WebWalkEvent consists of? 2 Quote Link to comment Share on other sites More sharing options...
Paradox68 Posted January 10, 2016 Author Share Posted January 10, 2016 My bad I'm multitasking I meant to ask if you could explain creating the conditionals and implementing them into WebWalkEvent breaks over teamviewer. lol Quote Link to comment Share on other sites More sharing options...
Chicken Wing Posted January 10, 2016 Share Posted January 10, 2016 My bad I'm multitasking I meant to ask if you could explain creating the conditionals and implementing them into WebWalkEvent breaks over teamviewer. lol Dude, frostbug literally gave you the code for it, just change the condition method to your own condition that you want to break the event Quote Link to comment Share on other sites More sharing options...
Paradox68 Posted January 10, 2016 Author Share Posted January 10, 2016 Dude, frostbug literally gave you the code for it, just change the condition method to your own condition that you want to break the event No options for import or anything. I'M LEARNING I'M SORRY Quote Link to comment Share on other sites More sharing options...
Chicken Wing Posted January 10, 2016 Share Posted January 10, 2016 No options for import or anything. I'M LEARNING I'M SORRY Make sure your library is the latest osbot (dev build too probably)? Works fine for me: Quote Link to comment Share on other sites More sharing options...