isOpen
isOpen: (Dialogue) -> booleanWhether a dialogue is open.
ui:dialogue()| Method | Returns | Description |
|---|---|---|
isOpen() | boolean | Whether a dialogue is open. |
kind() | DialogueKind? | What kind it is. |
text() | string? | The body text. |
speaker() | string? | Who is speaking. |
title() | string? | The dialogue's title. |
canContinue() | boolean | Whether a continue prompt is showing. |
typedInput() | TypedInputKind? | Which typed-input box is up, if any. |
typeAmount(number) | boolean | Type a number into the open amount box and submit it. |
clickContinue() | boolean | Click the continue prompt. |
pressSpace() | boolean | Press space when an open surface answers it: a continue dialogue, or the make-X box (Skillmulti), where space makes the highlighted produ… |
options() | { DialogueOption } | Every option currently offered. |
find(string) | DialogueOption? | The first option matching a pattern. |
| Method | Returns | Description |
|---|---|---|
Ui.dialogue | Dialogue | The open dialogue. |
isOpenisOpen: (Dialogue) -> booleanWhether a dialogue is open.
kindkind: (Dialogue) -> DialogueKind?What kind it is.
nil when nothing is open.texttext: (Dialogue) -> string?The body text.
nil when nothing is open, or it carries no text.speakerspeaker: (Dialogue) -> string?Who is speaking.
nil when nobody is named.titletitle: (Dialogue) -> string?The dialogue's title.
nil when it has none.canContinuecanContinue: (Dialogue) -> booleanWhether a continue prompt is showing.
typedInputtypedInput: (Dialogue) -> TypedInputKind?Which typed-input box is up, if any.
Today that is only the bank/Grand Exchange "Enter amount" box.
nil when nothing is asking for typed input.typeAmounttypeAmount: (Dialogue, number) -> booleanType a number into the open amount box and submit it.
amountclickContinueclickContinue: (Dialogue) -> booleanClick the continue prompt.
pressSpacepressSpace: (Dialogue) -> booleanPress space when an open surface answers it: a continue dialogue, or the make-X box (Skillmulti), where space makes the highlighted product. false otherwise. On an interface with no such surface (smithing, silver or gold crafting), ui:typeText(" ") presses space whatever is open.
optionsoptions: (Dialogue) -> { DialogueOption }Every option currently offered.
findfind: (Dialogue, string) -> DialogueOption?The first option matching a pattern.
patternnil when nothing matches.local dialogue = ui:dialogue()
if dialogue:isOpen() then
-- An option by its text, or nil when none is offered.
local option = dialogue:find("Yes")
if option then
option:press()
else
for _, offered in dialogue:options() do
log:info("{}: {}", offered:optionNumber(), offered:text())
end
end
end