Skip to main content

Dialog:show()

Shows the dialog and waits until the user presses OK.

Parameters​

ParametersTypeDescription
timeoutMsnumberOptional. Presses OK by itself after this many milliseconds, once every question that needs an answer has one. 0 waits for the user.

Signature​

Dialog:show(): void
Dialog:show(timeoutMs: number): void

Returns

void

Description​

The dialog opens with the answers from the last run filled in. When the user presses OK, the answers are saved for this macro, and the script goes on.

OK stays grey while a question that must be answered has no answer. The user sees Not set yet under it.

With pages, the dialog shows one page at a time (Next, Back) while there is something to answer, and tabs once everything is answered.

To skip the dialog while everything is already answered, use Dialog:showIfNeeded().

Examples​

Dialog:init()
Dialog:setTitle("Farm helper")
Dialog:add(NumberInput(1, "Runs", 10))
Dialog:show()
local runs = Dialog:getValueById(1)
Dialog:init()
Dialog:setTitle("Starting soon")
Dialog:add(CheckBox(1, "Collect daily rewards", true))
-- OK by itself after 5 seconds
Dialog:show(5000)

Notes​

  • Dialog:show() is the same as Dialog:show(0).
  • If the user presses Cancel, the macro stops, and the answers are not saved.
  • Before showing, the dialog checks the ids and showWhen rules, and stops with an error that names the problem.