Skip to content

prompt()

Warning

This page may contain outdated information, incompatible with the current version of Hercules and its coding standards.

Syntax

prompt("<option>"{, "<option>", ...});
prompt("<option>{:<option>:<option>}");

Warning

The rest of this document hasn't been converted to Markdown yet.

== Description == This function is a handy replacement for '[[menu]]' for some specific cases where you don't want a complex label structure - like, for example, asking simple yes-no questions. It will return the number of menu option picked, starting with 1. Like '[[menu]]', it will also set the variable @menu to contain the option the user picked.

And like '[[menu]]', the selected option is consistent with grouped options and empty options.

'[[prompt]]' works almost the same as '[[select]]', except that when a character clicks the Cancel button, this function will return 255 instead.

== Examples == [if] == 1) [[mes]] "You said yes, I know.";

[select]; [[set]] .@opt,20+@menu;

[[set]] .@choice$,"Apple:Banana:Lemon"; [select]; [explode]; [[mes]] "You have chosen "+.@option$[@menu-1];