kani339 Posted January 5, 2019 Share Posted January 5, 2019 (edited) Hello, i just started to getting into scripting for Osbot and faced a problem with crossing wilderness ditch. I searched forums and found couple of solutions but unfortunately none of them worked for me. So my problem is when script is clicking on cross wilderness there is a pop-up with message "Enter wilderness" script is waiting for several seconds before clicking on it but unfortuantly it just click again on "cross" if i test this separately bu just manually clicking on "Cross wilderness" it is working but not all code together. I would appreciate your help. Thank you! RS2Widget enterWild = getWidgets().getWidgetContainingText("Enter Wilderness"); RS2Object wildDitch = getObjects().closest("Wilderness Ditch"); if (wildDitch != null && !myPlayer().isAnimating()) { wildDitch.interact("Cross"); sleep(10000); if(enterWild != null) { log("Enter Wilderness"); enterWild.interact("Enter Wilderness"); sleep(8000); } } Edited January 5, 2019 by kani339 Quote Link to comment Share on other sites More sharing options...
Butters Posted January 5, 2019 Share Posted January 5, 2019 do getWidgets().getWidgetContainingText("Enter Wilderness"); after you interacted with the ditch (use ConditionalSleep btw instead of just sleep) You need to get the latest widget instance when you want to use it Quote Link to comment Share on other sites More sharing options...
kani339 Posted January 5, 2019 Author Share Posted January 5, 2019 Thank you so much for your help! So the only problem was that this element wasn't visible yet. Quote Link to comment Share on other sites More sharing options...