Register forum user name Search FAQ

MUSHclient scripting

Description of MUSHclient world function: world.Menu


Name Menu
Type Method
Summary Creates a pop-up menu inside the command window
Prototype BSTR Menu(BSTR Items, BSTR Default);
Description

This creates a pop-up menu inside the command window. This is intended to let you have context-sensitive items (or helpful reminders of MUD comamnds).

Items: A string containing the menu items to be displayed, see below.
Default: If provided, this item is selected.

The Items parameter is a string, containing the menu items to be displayed, separated by the "|" character. Leading and trailing spaces are removed from each item.

For example: Item = "Take|Wield|Drop|Equip"

There must be at least one item, or an empty string is returned.

The return value is the selected item, if any. If no item is selected (ie. the menu is dismissed) then an empty string will be returned.


Note: Available in version 4.64 onwards.


Lua example
-- make Ctrl+F2 show various options, and paste into command window

AcceleratorTo ( "Ctrl+F2" , 
                'PasteCommand (Menu ("chat|yell|ask|say"))', 
              sendto.script) 


-- display all functions
result = Menu (table.concat (utils.functionlist ( ), "|" ))
Lua notes
The Default parameter is optional and defaults to the empty string (ie. no default).
Returns If there was an error condition as described above, the empty string.

If the menu was dismissed, or no item selected, the empty string.

Otherwise, the text of the selected item, with leading and trailing spaces removed.
Introduced in version 4.64

See also ...

Function Description
WindowMenu Creates a pop-up menu inside a miniwindow

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.


Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes


Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes


View all functions

[Back]

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.