Docs · menu

menu

6 menu commands, generated from the engine's own registry — signatures, parameters and a worked example each. A does something command acts on the game; a needs x() one answers a confident wrong answer when its client hooks are missing.

clickMenu does something returns bool
clickMenu(command: string) -> bool

Clicks a row of a menu that is already open. Composed here rather than taken from the API, which clicks a row it is handed: this finds the row whose command matches and then hands it to the same aim-and-confirm click every interact uses. False when no menu is open or no row matches.

ParameterTypeWhat it does
commandrequired string the option to click
Example
if menuContains("Attack") { clickMenu("Attack") }
closeMenu does something returns bool
closeMenu() -> bool

Closes an open menu by moving the pointer off it, never by clicking - a left click on the world walks the character there or attacks whatever is standing on the spot. True when no menu is up afterwards.

Example
closeMenu()
hoveredSlot returns int
hoveredSlot() -> int

Which menu row the pointer is sitting on, 0 at the top, or -1 for none. For reporting: nothing needs it in order to click.

Example
print("pointer is on row", hoveredSlot())
menuContains returns bool
menuContains(command: string) -> bool

Whether the open menu offers this option. Case is ignored, and the target is not compared - "Attack" matches "Attack Goblin".

ParameterTypeWhat it does
commandrequired string the option to look for
Example
if menuContains("Talk-to") { clickMenu("Talk-to") }
menuCount returns int
menuCount() -> int

How many options the open menu has, or zero when none is open.

Example
if menuCount() > 0 { closeMenu() }
menuOptions returns list<string>
menuOptions() -> list<string>

The lines of the open menu, as the player reads them, or an empty list when none is open.

Example
for option in menuOptions() { print(option) }