Skip to content

Menu

menu {element} [parameters...]

Also searchable as: Menu · gui · window · dialog · form

menu builds a small window of your own, the menu window, with text, buttons, edit fields, check boxes, lists and images. The script shows it, reacts to clicks, and reads what the user typed or chose.

menu Clear
menu Window Title Loot settings
menu Window Size 220 110
menu Text lbl 10 12 Minimum gold:
menu Edit gold 110 10 90 100
menu Check bags 10 40 200 20 #true Also open bags
menu Button ok 70 75 80 25 Start
menu Show
set #MenuButton N/A
while #MenuButton = N/A
wait 1
menu GetNum gold 100
set %mingold #MenuRes
menu Get bags
set %openbags #MenuRes
menu Hide
display ok Minimum gold %mingold open bags %openbags
halt
  • Every control has a name, chosen when you create it. Names are not case-sensitive. Use a different name for each control: menu Get reads only the first one with a name.
  • Clicks put the button’s name in #MenuButton. Closing the window, with its × or with menu Hide, puts CLOSED there.
  • Values are read with menu Get and menu GetNum into #MenuRes, and changed with menu Set.
  • Positions and sizes are in pixels, from the top-left corner of the window’s inside.
  • The window stays open when the script stops. Start a script with menu Clear so it doesn’t add to an old menu.

menu Font … commands set the font, size, colours, style and alignment of the controls created after them; controls that already exist keep theirs. menu Clear puts every font setting back to its default: Arial 10, black on the standard button colour, left-aligned, plain, not transparent.

Wherever a colour is asked for, give either:

  • a name: black, white, red, green, blue, yellow, navy, gray, silver, … or a system colour such as btnface or windowtext;
  • a number in Windows’ order, $BBGGRR: blue first, red last. $0000FF is red, $FF0000 is blue. A web colour #0099FF becomes $FF9900.

A script runs #LPC lines (10 by default) and then pauses 50 ms, so a menu with a hundred controls takes about half a second to appear. Put set #LPC 1000 before building it.

Window
menu Show / menu Hide Shows or hides the menu window.
menu HideEUO Minimises EasyUO, leaving only the menu window.
menu Window Size, Title, Color, Transparent The window’s size, title, colour and opacity.
menu Clear / menu Delete Removes all controls, or one.
Controls
menu Text A label.
menu Button A button.
menu Edit / menu Memo A one-line / multi-line text field.
menu Check A check box.
menu Combo / menu List A drop-down list / a list box.
menu Shape A rectangle, circle or other shape.
menu Image Create An image to draw in or load a picture into: see the other menu Image commands.
Reading and changing
menu Get / menu GetNum Reads a control’s value into #MenuRes.
menu Set Changes a control’s text or state.
menu Activate Gives a control the keyboard focus.
EasyUO 1.6 only
menu Form Another window.
menu Panel An area that holds controls.
menu Radio A radio button.
menu GetProp / menu SetProp Reads or changes any property of a control or window.
menu GetDef / menu SetDef Reads or changes what new controls are created with, and where they go.
menu PushDef / menu PopDef Saves and brings back those defaults.
Reforged settings
menu Reforge Mode Chooses the 1.5 or the 1.6 MENU system for the script.
menu Reforge IncludeCall Makes the automatic choice read called files too.

What this page describes holds for both MENU systems, except where it speaks of names, CLOSED and the start of a script, which follow the 1.5 rules. In the 1.6 logic a name belongs to one control, a click gives the button’s name in lower case, menu Hide does not set CLOSED, and starting a script destroys every menu window and creates a new, hidden one. The details, and a table of which sub-command each system has, are on MENU: EasyUO 1.5 and 1.6.

See also

Based on the EasyUO wiki, edited for EasyUO Reforged. This text is available under the GNU Free Documentation License 1.2.

The EasyUO 1.6 behaviour on this page was researched with help from the ScriptUO community: Gaderian's tutorial New Menu Code and how to adapt old scripts and the scripts its members share at scriptuo.com.