Jump to content

Dialogues SelectOption


DragonAlpha

Recommended Posts

We can use the following method to check if the Select Option dialogue is open:

if(dialogues.isPendingOption()) {
   log("Select Option open, click on Yes.");
}

I used the widget debugger to find the widget ID of this, which is: 219

 

So I run the following code:

public int onLoop() {
   log("Is SelectOption Open: " + getWidgets().isVisible(219));
   return 100;
}

This correctly shows me true or false in the logs, when the dialogue is opened or closed. Great.

 

The thing I can't understand is though:

getWidgets().isVisible(219) // sometimes returns false even though the dialogue is open
dialogues.isPendingOption() // always returns true when it's open

Why is this? I've checked for other IDs, but it is always 219, and the 219 value is present in the OSBot.jar dialogues class.

 

(I don't just want to use isPendingOption(). I want to understand why this is not working and increase my knowledge).

 

Any thoughts?

Link to comment
Share on other sites

 

you need to read the text on the interface

 

            RS2Widget badDialog = widgets.getWidgetContainingText("Sorry, you may only use the targets");

 

Checking widget text is buggy in mirror mode, otherwise I'd be using it.

 

dialogues.isPendingOption() always worked in MirrorMode. I'm pretty sure it's not checking the text. I'm almost positive it's checking for the ID (being 219).

 

Had to disable text checking in my Kebab Buyer for MirrorMode compatibility:

 

828b9eb486.png

Edited by DragonAlpha
Link to comment
Share on other sites

Checking widget text is buggy in mirror mode, otherwise I'd be using it.

 

dialogues.isPendingOption() always worked in MirrorMode. I'm pretty sure it's not checking the text. I'm almost positive it's checking for the ID (being 219).

 

Had to disable text checking in my Kebab Buyer for MirrorMode compatibility:

 

828b9eb486.png

Which IDE u use?

Link to comment
Share on other sites

 

 whether a specific (or set of specific) widget(s) is/are active

 

Which widget root is it checking, just 219?

 

 

 

Pretty sure there are a couple dozen ids for dialogues. Why are you not using the Dialogues API?

 

Ok thanks I'll look into it.

 

I think I will just use the Dialogues API for this if I can't get it working.

 

I prefer to rely as little as possible on the higher API's and to try to understand how things work in the API. (If something breaks I've got the ability to fix it quick).

 

 

I know there are multiple different IDs for the Continue dialogues, but I am struggling to find anything besides 219 for Select Option. Poor standards below, the class is WIP.

 

cee46ab6b6.png


Which IDE u use?

 

Netbeans. It is Java's officially supported IDE.

Edited by DragonAlpha
Link to comment
Share on other sites

 

 

 

Which widget root is it checking, just 219?

 

 

 

 

Ok thanks I'll look into it.

 

I think I will just use the Dialogues API for this if I can't get it working.

 

I prefer to rely as little as possible on the higher API's and to try to understand how things work in the API. (If something breaks I've got the ability to fix it quick).

 

 

I know there are multiple different IDs for the Continue dialogues, but I am struggling to find anything besides 219 for Select Option. Poor standards below, the class is WIP.

 

cee46ab6b6.png

 

Netbeans. It is Java's officially supported IDE.

 

How u make it that color?

Link to comment
Share on other sites

The client caches them conditionally they don't use a static list.

You should probably do the same.

 

... or just use the Dialogue API tongue.png

 

I can't understand how. I haven't tried Mirror recently, but when I tried it anything regarding widgets getMessage() or containingText() did not work. But dialogues.isOption did work.

 

So we know it's not text being used. Is it something like, looking for the 2 sprites (those 2 swords) that are visible at the top left+right of the option menu. If so, those would be static ids too right? Unless they are looking at the height/width/color of the sword sprites, in which that check is against a static value too?

Link to comment
Share on other sites

I can't understand how. I haven't tried Mirror recently, but when I tried it anything regarding widgets getMessage() or containingText() did not work. But dialogues.isOption did work.

 

So we know it's not text being used. Is it something like, looking for the 2 sprites (those 2 swords) that are visible at the top left+right of the option menu. If so, those would be static ids too right? Unless they are looking at the height/width/color of the sword sprites, in which that check is against a static value too?

 

For caching across the multiple methods I've found:

 

1. The following string values are tested for

"Click here to continue", 
"to continue", 
"please wait..."
"Click to continue"

2. They following sprite is also checked

Sprites.SELECT_OPTION_SWORD2
Link to comment
Share on other sites

 

For caching across the multiple methods I've found:

 

1. The following string values are tested for

"Click here to continue", 
"to continue", 
"please wait..."
"Click to continue"

2. They following sprite is also checked

Sprites.SELECT_OPTION_SWORD2

 

Ok thanks for your advice.

 

Any idea how the API could do widget string checks in MirrorMode whilst Script's couldn't?

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...