ui
The ui namespace enables scripts to build interactive menu components, find and override native cheat settings, and structure layouts with gears and inline switches.
Menu Query Functions
Section titled “Menu Query Functions”ui.find
Section titled “ui.find”local groupbox = ui.find(tab: string, groupbox: string) --> groupbox_t | nillocal element = ui.find(tab: string, groupbox: string, widget: string, widget_type?: number) --> ui_element_t | nilLocates an existing native or script-created menu control.
- If not found, logs an error to the console and returns
nil. widget_typeis an optional integer disambiguator (see Widget Types).
ui.find_silent
Section titled “ui.find_silent”local element = ui.find_silent(tab: string, groupbox: string, widget?: string, widget_type?: number) --> ui_element_t | nilIdentical to ui.find, but returns nil without logging an error upon a miss. Ideal for feature probing.
ui.is_open
Section titled “ui.is_open”local menu_visible = ui.is_open() --> booleanReturns true if the cheat menu is currently open on screen.
ui.get_binds
Section titled “ui.get_binds”local keybinds = ui.get_binds() --> table of ui_element_tReturns a 1-based table of all active keybind widgets registered in the menu.
Creating Menu Items
Section titled “Creating Menu Items”ui.tab
Section titled “ui.tab”local tab_handle = ui.tab(name: string, icon?: string)Creates a top-level tab in the cheat menu navigation bar. icon defaults to the scripts icon if omitted.
ui.groupbox
Section titled “ui.groupbox”local gb = ui.groupbox(tab: string, name: string) --> groupbox_tCreates a groupbox container inside the specified tab.
Groupbox Widget Methods
Section titled “Groupbox Widget Methods”Call these methods on a groupbox_t instance using colon notation (:):
| Method | Parameters | Returns | Description |
|---|---|---|---|
gb:checkbox |
name: string, default?: boolean |
ui_element_t |
Boolean toggle switch. |
gb:slider_int |
name: string, min: number, max: number, default: number, format?: string |
ui_element_t |
Integer slider (format e.g. "%d px"). |
gb:slider_float |
name: string, min: number, max: number, default: number, format?: string |
ui_element_t |
Float slider (format e.g. "%.2f"). |
gb:combo |
name: string, ...options: string |
ui_element_t |
Single-choice dropdown combo. |
gb:multicombo |
name: string, ...options: string |
ui_element_t |
Multi-choice dropdown with checkboxes. |
gb:listbox |
name: string, ...options: string |
ui_element_t |
Single-choice scrolling listbox. |
gb:listbox_multi |
name: string, ...options: string |
ui_element_t |
Multi-choice scrolling listbox. |
gb:color_picker |
name: string, default?: color |
ui_element_t |
RGBA color picker. |
gb:keybind |
name: string |
ui_element_t |
Hotkey binder (hold / toggle / always). |
gb:input |
name: string |
ui_element_t |
Single-line text input field. |
gb:button |
name: string |
ui_element_t |
Clickable action button. |
gb:label |
name: string |
ui_element_t |
Static text label. |
ui_element_t Methods
Section titled “ui_element_t Methods”| Method | Returns | Description |
|---|---|---|
el:get() |
any |
Returns the current active value based on widget type. |
el:get(index: number) |
boolean |
Required for multicombo / multi-listbox: Returns whether 0-based option is checked. |
el:set(value: any) |
nil |
Sets the value programmatically. Does not fire callbacks (except on combos). |
el:set(value: boolean, index: number) |
nil |
Sets option state for multicombo / multi-listbox. |
el:override(value?: any) |
nil |
Sets a runtime-only override for get(). Pass nil or no arguments to clear overrides. |
el:override(value?: boolean, index?: number) |
nil |
Sets or clears runtime override for a multicombo / multi-listbox option. |
el:set_callback(fn: function) |
nil |
Registers a callback triggered whenever the widget value changes in the menu. |
el:visible(shown: boolean) |
nil |
Toggles widget visibility in the groupbox. |
el:update_list(options: table) |
nil |
Replaces available options in combo and listbox elements. |
el:type() |
number |
Returns the numeric widget type ID. |
el:get_name() |
string |
Returns current label text. |
el:set_name(text: string) |
nil |
Updates the displayed label text. |
el:get_mode() |
number |
Keybind only: 0 (Hold), 1 (Toggle), 2 (Always on). |
el:get_key() |
number |
Keybind only: Virtual key code. |
el:add_gear_item(child: ui_element_t) |
ui_element_t |
Moves child into this element’s gear popup panel (chainable). |
el:add_switch(checkbox: ui_element_t) |
ui_element_t |
Attaches a checkbox as an inline switch on the far left side of this row. |
Widget Types & Value Mappings
Section titled “Widget Types & Value Mappings”| Type ID | Widget Type | el:get() Return Value |
el:set() Parameter |
|---|---|---|---|
0 |
Checkbox | boolean |
boolean |
1 |
Slider (int) | number |
number |
2 |
Slider (float) | number |
number |
3 |
Keybind | boolean (is active) |
boolean (toggle mode) |
4 |
Label | string |
string |
5 |
Color picker | color |
color |
6 |
Combo | number (0-based option index) |
number |
7 |
List box | number (0-based selected row) |
number |
8 |
Multi-combo | boolean (requires 0-based index) |
boolean, index |
9 |
Button | nil |
N/A |
10 |
Input | string |
string |
11 |
Any (query filter) | N/A | N/A |
12 |
Multi-listbox | boolean (requires 0-based index) |
boolean, index |
