Jump to content

Detecting an open widget over the game screen.


apa

Recommended Posts

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");

}

 

Link to comment
Share on other sites

 

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 by apa
  • Like 1
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...