yesno
Syntax: %yesno(message,button1,button2...)
Displays message returns true or false depending upon which button is clicked. See #YESNO for more options. If more than two buttons are displayed, the result is the button number, making this useful in conjunction with #CASE. With only two buttons, 0 or 1 is returned, making this useful in conjunction with #IF.
Example:
#IF (%yesno("Do you really want to quit now?")) {quit} {resume}
displays a dialog with a 'Yes', a 'No', and a 'x' (Cancel) button. Only if 'Yes' is clicked, the quit command will be sent to the MUD. Otherwise 'resume' is sent to the MUD.
Local Variables were added to CMUD after the %yesno function was initially developed, you can now use them as follows:
$tmp = 0
#if (%yesno("Yes or no?")) {$tmp = 1} {$tmp = 2}
#print {The value of tmp is $tmp} |