Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Implemented ChatDialog suggestions

Author of MaxiBots
Joined
Dec 3, 2013
Messages
6,774
I think ChatDialog.getTitle() and getOption(Pattern) would be very useful. The latter making it possible to deal with an entire conversation in one line of code.

@Cloud
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
Support for ChatDialog.getTitle
In regards to getOption(Pattern), what exactly would it be matching against? The text? Would only one pattern be required in the constructor or should we accept multiple for further simplicity?

Edit: Added Option getOption(Pattern... patterns)
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
6,774
Support for ChatDialog.getTitle
In regards to getOption(Pattern), what exactly would it be matching against? The text? Would only one pattern be required in the constructor or should we accept multiple for further simplicity?
The text is what i had in mind. My idea was if i need to handle selecting multiple options going deep into a chat dialog, instead of having X if statements all checking the text, or a for loop looping over them and checking the text, i could just write a pattern that handled all options i need to choose
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
The text is what i had in mind. My idea was if i need to handle selecting multiple options going deep into a chat dialog, instead of having X if statements all checking the text, or a for loop looping over them and checking the text, i could just write a pattern that handled all options i need to choose
I mean currently you can pass in multiple Strings and it will return the first option containing one of them. But I've gone ahead and added the ability to use Patterns within itt.
 
Joined
Dec 10, 2014
Messages
3,255
The text is what i had in mind. My idea was if i need to handle selecting multiple options going deep into a chat dialog, instead of having X if statements all checking the text, or a for loop looping over them and checking the text, i could just write a pattern that handled all options i need to choose
You could use the String... argument, since that takes multiple Strings?
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
6,774
I mean currently you can pass in multiple Strings and it will return the first option containing one of them. But I've gone ahead and added the ability to use Patterns within itt.
Oh, i didn't realize it already took a vararg. Is there any benefit to having both?
 
You could use the String... argument, since that takes multiple Strings?
Yeah lol just found that out
 
The Pip Collector
Joined
Sep 14, 2014
Messages
445
So the string argument is based on the hierarchy of options right? So if an option is placed first, then another next, it will look for the first one before going to the second one?
 
Joined
Mar 26, 2014
Messages
33
Support for ChatDialog.getTitle
In regards to getOption(Pattern), what exactly would it be matching against? The text? Would only one pattern be required in the constructor or should we accept multiple for further simplicity?

Edit: Added Option getOption(Pattern... patterns)

Theres no need for it to be varags really, if there are multiple text options that would be viable or must be there the user can already specify this in there regex pattern
 
Joined
Dec 10, 2014
Messages
3,255
Theres no need for it to be varags really, if there are multiple text options that would be viable or must be there the user can already specify this in there regex pattern
Ehhh, I'm sure there's still some edge case where varargs are needed, or at least more practical than jamming them all into a single pattern
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
Theres no need for it to be varags really, if there are multiple text options that would be viable or must be there the user can already specify this in there regex pattern
My logic was that it's easier to write simple patterns than it is complex ones.
 
First Bot Author
Joined
Aug 7, 2013
Messages
262
Ehhh, I'm sure there's still some edge case where varargs are needed, or at least more practical than jamming them all into a single pattern
You can create separate patterns and join them at compile time easily, though.
 
Top