PICK
Syntax: #PI val1 val2 val3...
Display a pickbox with val1, val2, val3, ... listed on each line. The user can select one or more of these lines and return them. The values are returned separated by the current command separator ( ; ) and executed as commands. If the user presses Escape then no commands are executed.
The PICK command recognized two special arguments. An argument of the format p:string displays the specified string as the prompt for the dialog. An argument of o:1 specifies that only one selection is allowed to be chosen. Also, each value can start with an asterisk * to indicate that it is selected by default when the dialog is displayed.
To display captions for each item that are different from the command, use the syntax caption:command. The caption is displayed in the list, but the command is executed.
PICK examples
#PI {get all corpse} {get all.coins corpse} {sac corpse}
displays a picklist with three values. If the user selects the first and third option, the string 'get all corpse;sac corpse' is returned and executed.
#VAR Actions "p:Select an action|o:1|kill @mob|kick @mob|*stun @mob"
#PICK {@Actions}
displays a picklist with three values. The string "Select an action" is displayed as the prompt for the dialog box. The o:1 option specifies that only one value can be selected from the list. The * in front of the third item specifies the default item to be chosen by pressing Enter. By putting the actions in a variable (@Actions) and then using the variable with the #PICK command, the actions in the variable are expanded when #PICK displays them. So, if @mob is "Orc", the actions "kill orc", "kick orc", etc are displayed.
#PICK {p:Select an action:} {o:1} {kill:kill @mob} {kick:kick @mob} {*stun:stun @mob}
Same as the above example, except shorter captions are displayed in the list rather than the entire commands. Here you don't need the @Action variable since the titles for each action are specified and don't need to be expanded. |