[Home] [Downloads] [Search] [Help/forum]

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);

View list of data type meanings


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, an paste into command window

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

-- 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


Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]