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?