Skip to content

#MenuButton

VariableResultRead / writeStringDiffers in 1.5 and 1.6

Also searchable as: #MenuButton · MenuButton · button clicked

#MenuButton is the name of the last menu button clicked, in capital letters. When the menu window is closed, with its × or with menu Hide, it becomes CLOSED.

It keeps the last value until the next click, so set it to something else before waiting for a click. Comparisons ignore case.

menu Clear
menu Window Size 160 45
menu Button ok 10 10 60 25 OK
menu Show
set #MenuButton N/A
while #MenuButton = N/A
wait 1
if #MenuButton = closed
display ok You closed the window.
else
display ok You clicked #MenuButton
halt
1.5 1.6
A button click the name in capitals the name in lower case
The window’s × CLOSED CLOSED for the main window; another menu Form gives its own name
menu Hide CLOSED unchanged
menu Clear unchanged emptied
A script starting unchanged emptied

In 1.6, setting it to form0 reads back as CLOSED. See 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.