Skip to content
desht edited this page Aug 10, 2011 · 20 revisions

Usage

Note that all /sms commands use a sub-command, e.g. /sms create ..., /sms delete ..., etc. All sub-commands can be abbreviated to the shortest unique spelling, so /sms c ... is the same as /sms create ..., and so on. This can save a lot of typing.


Creating a menu

Method 1

To create a new scrolling menu, place a sign (contents don't matter, it can be blank), look at it, then type: /sms create <title>

name is a unique name to identify the menu. title is the menu title, and is always shown as the top line of the scrolling menu sign.

When you do this, the menu becomes associated with the sign. The sign's appearance will change; the title will be shown as "Title" centred on the first line, and the third line will look like ">" (this is the currently selected menu item - it's blank because the menu has no entries yet).

Example:

/sms create mymenu Time of Day

Menu titles can be coloured - use the '&X' notation to specify a colour. Example:

/sms create mymenu &4Time of Day

gives the sign a red title. See http://www.minecraftwiki.net/wiki/Classic_server_protocol#Color_Codes for a list of the numeric (hex) codes (yes, that page is from Classic, but the codes are still valid). Be aware that colour codes use up characters from the sign's 15 characters-per-line limit.

Technically you don't need to look at a sign to create a menu - menus can be created with 0 entries if you're not looking at a sign (or are on the console). If you do that, you'll need to add signs using Method 3 below.

Method 2

Alternatively, you can place a sign with the following text:

LINE 1: [sms]
LINE 2: <name>
LINE 3: <title>
LINE 4: (BLANK)

When you punch (i.e. left-click with no held item) such a sign, a menu will be created and associated with the sign, if possible.

Method 3

You can add a new sign to an existing menu too. In this case, the sign is automatically synchronised with all other signs belonging to that menu - only the scrolling position is maintained independently. To do this, look at a sign (which doesn't belong to any menu) and type:

/sms sync <existing-name>

Or you can create a sign with the following text:

LINE 1: [sms]
LINE 2: <existing-name>
LINE 3: (BLANK)
LINE 4: (BLANK)

and punch it, as in Method 2.

Method 4

Finally, you can create a new menu as a copy of an existing menu. Look at a sign and type:

/sms create <name> from <other-name>

where other-name is the unique identifier of a menu that already exists.

Example:

/sms create mymenu2 from mymenu

mymenu2 will be an exact copy of mymenu, including the title. However, after it's created, the two menus will be independent of each other; any items added to one menu will not appear in the other. If you want that, see Method 3.


Destroying a menu

To destroy a menu, there are two options:

  • Look at a menu sign, and type /sms delete
  • Type /sms delete _name_ where name is a unique menu name

When you do this, all signs that were associated with the menu will go blank and will just be ordinary signs.


Removing a sign from a menu

If you want to remove a sign from a menu, there are a few options:

  • Look at a sign, and type /sms break.
  • Take an axe to the sign!
  • Break the block to which the sign is attached.

Destroying a sign which has a menu created by another player is only allowed with the appropriate permission (see Permissions page).

Note that taking an axe to the sign will trigger the sign's currently selected menu item if left-click is configured to execute items (which is the default). So using /sms break is the preferred option.

Example:

/sms break

Changing a menu's title

To change a menu's title, type /sms title _name_ _new title_

Example:

/sms title mymenu &2Time of Day

Colour codes are accepted, as in /sms create.


Adding menu entries

To add a menu item to an existing menu, type /sms add _name_ _item-specifier_

The syntax of item-specifier is "label|command[|message]". This is most easily explained by example:

/sms add mymenu Day|/time day|It's daytime!
/sms add mymenu Night|/time night|It's night time!

adds a menu entry to the menu called mymenu with a label of "Day", and one with a label of "Night". If "Day" is executed (left-clicked), it will issue "/time day" as a command, and send a message to the player of "It's daytime!". Similarly for "Night".

The default field separator is the vertical bar (|) - if you don't like that, you can change it to any other string - example:

/sms setcfg menuitem_separator ::

Then you can do:

/sms add mymenu Day::/time day::It's daytime!

You can also leave out the message if you want, e.g.:

/sms add mymenu Compass|/compass

Or you can leave out the command, which might be useful if you just want some feedback text to be shown to the player:

/sms add mymenu Help||This is some help text!

If the command doesn't start with a slash (/), then the player will speak the command string instead, e.g.:

/sms add mymenu Say hello|Hello everyone!

Menu labels and feedback text can be coloured, just like sign titles. The same syntax applies. Example:

/sms add mymenu &1Compass|/compass

gives this entry a blue label.

Note that the CommandSigns plugin is supported and commands can be passed to that - see the CommandSigns page for more information.


Removing menu entries

To remove a menu item from an existing menu, type /sms remove _name_ _index_. Example:

/sms remove mymenu 1 

removes the first item in the menu. To find which index corresponds to which item, you can use /sms show, see below. You can also remove items by label:

/sms remove mymenu Compass

(If the label contains colour codes, don't worry - you don't need to type those in)


Sorting a menu's entries

By default, menu items just appear in the order in which you add them - most recently added items always appear at the end of the list. If you want to sort your menu into alphabetical order (by menu item label), you can do:

/sms sort mymenu

This will sort all the items in the menu, and disable autosorting. Autosorting is a feature whereby any new items added to your menu will automatically get sorted into alphabetical order. To enable this for a menu, do this:

/sms sort mymenu auto

Now the menu will always remain sorted - no need to manually sort it. To switch autosorting off again, just do /sms sort mymenu.



Interacting with a menu

These are the default bindings to interact with a menu (but they are fully configurable - see the Config page):

  • Left-click on a menu executes the currently-selected item
  • Right-click on a menu scrolls the menu downwards
  • Shift (sneak) + right-click on a menu scrolls the menu upwards
  • Shift + mouse wheel up or down while looking at a menu scrolls it in the corresponding direction

Listing all menus

To show all menus that have been defined, use /sms list. Example:

/sms list
1 line (page 1/1)
-------------------------
mymenu "Time of Day" [3 items] [2 signs]
 - @ -477,68,104 world
 - @ -48,83,-8 world
-------------------------

That's the menu named "mymenu" at locations (-477,68,104) and (-48,83,-8) on world "world" with title "Time of Day", and has 3 entries.


Show menu detail

To show the menu items for a menu, use /sms show _name_. Example:

/sms show mymenu
4 lines (page 1/1)
-------------------------
Menu 'mymenu': title 'Time of Day'
 1) Day [/time day] "It's daytime!"
 2) Night [/time night] "It's night time!"
 3) Compass [/compass] ""
-------------------------

Output paging

The output of /sms list and /sms show could be too large to fit on screen. In this case, further pages of output from the last list or show command can be shown with /sms page _page-num_. Example:

/sms page 2

Forcing menu data & configuration to be saved

To force menu and configuration data to be written to disk immediately:

/sms save

You will not normally need to do this, since it's automatically done if the server is stopped or if the plugin is reloaded. Additionally, configuration data is saved whenever a change is made via "/sms setcfg".

The following data files (in plugins/ScrollingMenuSign) are used:

  • config.yml - stores plugin Config items
  • scrollingmenus.yml - menu persistence data
  • commands.yml - stores command Macros

Forcing menu data & configuration to be reloaded

To force menu and configuration data to be reloaded:

/sms reload

This may be useful if you choose to edit the config.yml, commands.yml or scrollingmenus.yml data files directly.