New function: Menu

Posted by Nick Gammon on Sat 02 Oct 2010 03:02 AM — 1 posts, 4,973 views.

Australia Forum Administrator #0
Version 4.64 of MUSHclient has a new script function designed to help ease playing your MUD.

The function "Menu" displays a small menu at the current cursor in the command window, consisting of any items you like.

Functionally, this is very similar to the "function-name completion" menu that appears if you hit Shift+Tab.

The intention is that you could bind it to various keys to remind you of possible commands that you might use (eg. chatting commands, training commands).

For example:


selection = Menu ("chat|yell|ask|say")


If a selection is made it will be one of the above words (eg. "yell").

If the menu is dismissed by pressing Esc then an empty string is returned.

Here is an example of how you might combine that with an accelerator key. Now if you press Ctrl+F2, the menu will appear, and whatever is chosen will be pasted into the command window, to save you typing it:


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