Settings UI and config
Your script's own settings, and evasive's settings and profiles.
ui
Controls in the script's group of the menu (Scripts > Settings), saved in the user's config. Each returns a Control.
ui.checkbox(label [, default]) -> ControlCheckbox in the script's settings group. Labels are ids; add ##suffix to repeat a label.
| Name | Type | Default | Description |
|---|---|---|---|
label | string | ||
defaultoptional | boolean | false |
Control
local enabled = ui.checkbox("Enabled", true)ui.slider(label, min, max [, default [, opts]]) -> ControlSlider; opts = {decimals = 0..4, suffix = "px"}.
| Name | Type | Description |
|---|---|---|
label | string | |
min | number | |
max | number | |
defaultoptional | number | |
optsoptional | table |
Control
local size = ui.slider("Size", 1, 40, 10, {suffix = "px"})ui.combo(label, items [, default]) -> ControlSingle choice (1-based index; at most 64 items).
| Name | Type | Default | Description |
|---|---|---|---|
label | string | ||
items | string[] | ||
defaultoptional | integer | 1 |
Control
local mode = ui.combo("Mode", {"Text", "Circle"}, 1)ui.multi_combo(label, items [, default]) -> ControlMultiple choice; :get() returns a table of booleans.
| Name | Type | Description |
|---|---|---|
label | string | |
items | string[] | |
defaultoptional | boolean[] |
Control
local parts = ui.multi_combo("Parts", {"Head", "Body"}, {true, false})ui.color(label [, default]) -> ControlColour swatch on the right of the previous row.
| Name | Type | Description |
|---|---|---|
label | string | |
defaultoptional | color |
Control
local col = ui.color("Colour", color(143, 108, 240))ui.keybind(label [, key [, mode]]) -> ControlKey binding; mode "hold", "toggle" or "always". Use :active().
| Name | Type | Default | Description |
|---|---|---|---|
label | string | ||
keyoptional | integer | 0 | |
modeoptional | string | hold |
Control
local key = ui.keybind("Key", vk.f, "toggle")ui.text_input(label [, default [, max_len]]) -> ControlSingle-line text field.
| Name | Type | Default | Description |
|---|---|---|---|
label | string | ||
defaultoptional | string | ||
max_lenoptional | integer | 64 |
Control
local label = ui.text_input("Label", "hello", 32)ui.button(label, callback) -> ControlButton; the callback runs on the next frame (inside the budget).
| Name | Type | Description |
|---|---|---|
label | string | |
callback | function |
Control
ui.button("Reset", function() storage.set("n", 0) end)ui.label(text) -> ControlA line of text.
| Name | Type | Description |
|---|---|---|
text | string |
Control
ui.label("Made by me")ui.separator([title]) -> ControlA titled separator.
| Name | Type | Description |
|---|---|---|
titleoptional | string |
Control
ui.separator("Advanced")ui.accent() -> colorThe menu accent colour.
color
draw.rect_filled(0, 0, 10, 10, ui.accent())Everything here needs Allow scripts to edit cfg files in Scripts > Security (off by default).
config.get(path) -> anyAn evasive setting by its path "section.field" (the blocks and keys of config/<name>.cfg).
| Name | Type | Description |
|---|---|---|
path | string |
any
local on = config.get("esp.enabled")config.set(path, value) -> booleanChanges an evasive setting (same type as the current value). Not saved until config.save().
| Name | Type | Description |
|---|---|---|
path | string | |
value | any |
boolean
config.set("esp.enabled", false)config.save() -> booleanSaves the active profile.
boolean
config.save()config.active() -> stringName of the active profile.
string
log.info(config.active())config.list() -> string[]Profile names.
string[]
for _, n in ipairs(config.list()) do endconfig.load(name) -> booleanSwitches to another profile (script values from it apply; the loaded-script set is not changed from a script).
| Name | Type | Description |
|---|---|---|
name | string |
boolean
config.load("legit")Control:get() -> anyCurrent value: boolean, number, integer (combo, 1-based), boolean[] (multi_combo), color, integer (keybind key), string.
any
if enabled:get() then endControl:set(value)Sets the value (labels: the text).
| Name | Type | Description |
|---|---|---|
value | any |
enabled:set(false)Control:active() -> booleanKeybinds: held (hold), toggled (toggle) or always. False while the menu is open or a text field has focus.
boolean
if key:active() then endControl:visible(shown)Shows or hides the control.
| Name | Type | Description |
|---|---|---|
shown | boolean |
size:visible(enabled:get())Control:on_change(callback)Called with the new value when the control changes (menu, profile load or :set).
| Name | Type | Description |
|---|---|---|
callback | function |
enabled:on_change(function(v) log.info(v) end)Control:name() -> stringThe display label.
string
local n = enabled:name()