Jump to content

Dialogues SelectOption


Recommended Posts

Posted

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?

Posted (edited)

 

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
Posted

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?

Posted (edited)
 

 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
Posted

 

 

 

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?

Posted

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?

Posted

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
Posted

 

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?

Posted

Ok thanks for your advice.

 

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

 

I'm pretty sure widget string checking isn't broken in mirror.

Maybe you're checking the wrong widget?

 

To be sure, test both clients and compare the results... but I'd be surprised.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...