If you have to execute some actions even if you do not select a 'valid' option in the menu, why wouldn't you create an option called 'do nothing' or 'none of these' (corresponding to the value zero)?
For the rest of your request, yes, depending on the complexity of your/our needs, it's sometimes necessary to use some lines of code. But it's fun!
MacroDroid is a kind of 'Tool box' where you can find nearly all the possible tools to do whatever you want (inside Android/Google limits, which become narrower every month
) in a very intuitive manner unlike a programming language. Unlike a dedicate app, MD is very versatile and sometimes we have to create our 'homemade functions' to exactly fit our own needs...
Good luck and have fun!
Sorry for the late reply, I missed your message and only just remembered that I posted this question.
As per my previous reply, when you create a "integer: [User Prompt]" variable, the default value is 0 and you cannot modify this (as far as I know). You can't simultaenously use 0 for a default option and also to cancel the prompt at the same time.
Take the following for example:
Set variable:
User_Choice: [User Prompt]
User prompt shows:
1 - Option A
2 - Option B
if (User_Choice = 1){
do something...
}
if (User_Choice = 2){
do something...
}
When the prompt pops up, the input box has a default value of 0. Assuming you don't modify this value, then when you press OK, it should do nothing - because there is no "if (User_Choice = 0)" condition. The same is true when you press Cancel, the popup should go away and nothing happens. That's fine, that's what we want.
Now, let's say you want to make use of the default value of 0.
Set variable:
User_Choice: [User Prompt]
User prompt shows:
1 - Option A
2 - Option B
if (User_Choice = 0){
do something...
}
if (User_Choice = 1){
do something...
}
if (User_Choice = 2){
do something...
}
Again, when the user prompt pops up, the value 0 is there by default. When you press OK, it starts executing the code under "if (User_Choice = 0)". That's great.
BUT, what happens when you want to CANCEL the prompt? Well, the code under "if (User_Choice = 0" gets executed anyway. Why? Because like I said, the "Cancel" action in the user prompt doesn't actually cancel properly. Since the "integer: [User Prompt]" always has a default value of 0, then the condition "if (User_Choice = 0)" will always get executed. So the "Cancel" action is bugged here and needs to be fixed.
Currently, I don't have a condition for "if (User_Choice = 0)" and so when I click Cancel on the prompt, it does nothing. However, like I said above, you lose the ability to make use of the default value of 0 properly. So what also needs to be addressed here is the ability to modify the default integer value for the "integer: [User Prompt]" variable.
Now, even if both those issues were fixed, it's still a pretty crappy user experience. I don't want to have to type backspace to delete the number (again, 0 is the default) and then type in the number I want. It is slow and an inefficient process. It is MUCH BETTER to simply tap an option/choice button, like the one you get from the "if confirmed" option. Like I said, "if confirmed" needs to be enhanced/extended so that it provides multiple options for you to select. Currently, it only presents the option of "Confirmed" and "Cancelled".