What Is a Dialog?
A dialog asks the person running your macro a few questions before it starts: how many runs, which mode, where the Attack button is on their screen. Your macro reads the answers and behaves accordingly.
The app remembers the answers for each macro. The next time the dialog opens, the answers are already filled in, so the user only presses OK, or you can skip the dialog completely once everything is answered (see Every Run or Only When Needed).
A dialog is also the only way users can adapt a macro they can't edit, such as one from the Store, to their own phone.
What you can ask
| Block | In Lua | The user... | Your macro gets |
|---|---|---|---|
| text | TextView | reads a line of text | nothing |
| checkbox | CheckBox | ticks a box | true or false |
| text input | EditText | types text | text |
| number input | NumberInput | types a number | a number |
| slider | Slider | slides to a number | a number |
| options | RadioGroup + RadioButton | picks one choice | the id of the chosen option |
| dropdown | RadioGroup:showAsDropdown() | picks one choice from a list | the id of the chosen option |
| tap picker | TapPicker | taps a spot on their own screen | a Point |
| tap list picker | TapListPicker | taps several spots in order | a list of Points |
| touch recorder | GestureRecorder | plays a routine once | a record name for play touch record |
See Question Types for each one.
Arranging the questions
| Block | In Lua | What it does |
|---|---|---|
| page | Page | Splits a long dialog into pages. The first time, they show one at a time; after that, as tabs. |
| section | Section | A titled group the user can fold, for example "Advanced". |
| next items side by side / next items stacked | Row / Column | Puts the items after it next to each other, or back under each other. |
| show when | showWhen / hideWhen | Shows a question only while a checkbox or choice has a certain answer. |
See Pages, Sections and Rows and Show a Question Only When It Matters.
Ids
Every question has an id, a number. You read an answer by its id, and the app saves it under that id, so each question in a macro needs its own. Options have ids too, which only need to be different within their own list.
In the Block Editor you rarely type them yourself: a question you drag in gets the next free id, and if you type an id that another question already uses, the editor warns you and offers a free one.