apa Posted April 24, 2015 Share Posted April 24, 2015 How would I be able to detect if there's any open widget on the game screen? I can't seem to do it by checking for changes in other widgets when a widget opens up. I found clicking the run button closes all interfaces, but I need to still be able to check if there is a widget that should be closed. Thanks! Quote Link to comment Share on other sites More sharing options...
Alek Posted April 24, 2015 Share Posted April 24, 2015 widgets.getWidgets() ? Quote Link to comment Share on other sites More sharing options...
apa Posted April 24, 2015 Author Share Posted April 24, 2015 (edited) widgets.getWidgets() ? I've really gotta explore the API more, I rewrote half the methods in the widgets class... thanks lol Edit: widgets.closeOpenInterface(); doesn't close The collect, Sets, or GE History widgets however. Edited April 24, 2015 by apa Quote Link to comment Share on other sites More sharing options...
Bucket1337 Posted April 24, 2015 Share Posted April 24, 2015 I've really gotta explore the API more, I rewrote half the methods in the widgets class... thanks lol Edit: widgets.closeOpenInterface(); doesn't close The collect, Sets, or GE History widgets however. http://osbot.org/forum/topic/69297-close-ge-collection-box-notice-board/?hl=collection%20box In case your bank interaction misclicks ^^//close collectionbox (by Botre)RS2Widget collectionBox = getWidgets().get(402, 2, 11); if (collectionBox != null && collectionBox.isVisible()) { collectionBox.interact("Close"); } And this one by @Novak//close noticeboard (by Novak)RS2Widget noticeBoard = script.getWidgets().get(220, 16); if(noticeBoard != null && noticeBoard.isVisible()) { noticeBoard.interact("Close"); } Quote Link to comment Share on other sites More sharing options...
apa Posted April 24, 2015 Author Share Posted April 24, 2015 (edited) http://osbot.org/forum/topic/69297-close-ge-collection-box-notice-board/?hl=collection%20box Thanks, I just rewrote mine to check if any wrong interface is open using the sprite of the close button, because it can also misclick the GE in my bot and I didn't want to make a bunch of cases as the Sets and History widgets have different children IDs: if (!isGEOpen() && !isBankOpen() && widgets.containingSprite(535).size() > 0) { if (containsSelection(548, 94, "Toggle Run", true)) { interactInterface(548, 94, "Toggle Run"); } } Edited April 24, 2015 by apa 1 Quote Link to comment Share on other sites More sharing options...