DragonAlpha Posted April 12, 2016 Share Posted April 12, 2016 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? Quote Link to comment Share on other sites More sharing options...
Stitch Posted April 12, 2016 Share Posted April 12, 2016 you need to read the text on the interface RS2Widget badDialog = widgets.getWidgetContainingText("Sorry, you may only use the targets"); Quote Link to comment Share on other sites More sharing options...
DragonAlpha Posted April 12, 2016 Author Share Posted April 12, 2016 (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: Edited April 12, 2016 by DragonAlpha Quote Link to comment Share on other sites More sharing options...
Alek Posted April 12, 2016 Share Posted April 12, 2016 Pretty sure there are a couple dozen ids for dialogues. Why are you not using the Dialogues API? Quote Link to comment Share on other sites More sharing options...
progamerz Posted April 12, 2016 Share Posted April 12, 2016 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: Which IDE u use? Quote Link to comment Share on other sites More sharing options...
Botre Posted April 12, 2016 Share Posted April 12, 2016 isPendingOption() at no point checks for widget 219's visibility. It checks if the chatbox is not visible, whether a specific (or set of specific) widget(s) is/are active and it checks for sprite matches. Quote Link to comment Share on other sites More sharing options...
DragonAlpha Posted April 12, 2016 Author Share Posted April 12, 2016 (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. Which IDE u use? Netbeans. It is Java's officially supported IDE. Edited April 12, 2016 by DragonAlpha Quote Link to comment Share on other sites More sharing options...
progamerz Posted April 12, 2016 Share Posted April 12, 2016 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. Netbeans. It is Java's officially supported IDE. How u make it that color? Quote Link to comment Share on other sites More sharing options...
DragonAlpha Posted April 12, 2016 Author Share Posted April 12, 2016 How u make it that color? Click Tools at the top, select Options. Click Fonts & Colors Select Profile Norway Today: Dark coloured backgrounds, and light text is preferable as it reduces eye-strain. 2 Quote Link to comment Share on other sites More sharing options...
Botre Posted April 12, 2016 Share Posted April 12, 2016 Which widget root is it checking, just 219? The client caches them conditionally they don't use a static list. You should probably do the same. ... or just use the Dialogue API :p Quote Link to comment Share on other sites More sharing options...
progamerz Posted April 12, 2016 Share Posted April 12, 2016 Click Tools at the top, select Options. Click Fonts & Colors Select Profile Norway Today: Dark coloured backgrounds, and light text is preferable as it reduces eye-strain. Tyvm Quote Link to comment Share on other sites More sharing options...
DragonAlpha Posted April 12, 2016 Author Share Posted April 12, 2016 The client caches them conditionally they don't use a static list. You should probably do the same. ... or just use the Dialogue API 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? Quote Link to comment Share on other sites More sharing options...
Botre Posted April 12, 2016 Share Posted April 12, 2016 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 Quote Link to comment Share on other sites More sharing options...
DragonAlpha Posted April 12, 2016 Author Share Posted April 12, 2016 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? Quote Link to comment Share on other sites More sharing options...
Botre Posted April 12, 2016 Share Posted April 12, 2016 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. Quote Link to comment Share on other sites More sharing options...