GriefBot

Script settings

Scripts · Added

A script can add switches, sliders, dropdowns, colours, keys and buttons, drawn in its card's cog and saved for you.

How it works

A Lua script can give itself settings, and they appear in its card's cog on the Scripts tab, drawn like every other row in the menu and saved for you. Seven kinds are available: an on/off switch, a slider for a number, a whole-number slider, a dropdown of up to 16 options, a colour picker with transparency, a key bind with the usual Hold, Toggle, Hold to turn off and Always modes, and a button that runs a function when clicked. A script declares them when its file first runs, up to 32, and reads their values whenever it needs them, so a change in the menu applies at once. Values are remembered by label, so renaming a setting starts it from its default. A script can hide a setting that only matters while another is on, and give a row its own hover text.

Settings

In the menu: Each script card's cog, Scripts tab

ui.toggle
An on/off switch.
ui.slider
A slider for a number, with its own printed format such as "%.0f px".
ui.slider_int
A slider for a whole number.
ui.combo
A dropdown of 1 to 16 options.
ui.color
A colour picker with transparency.
ui.key
A key the user binds, with a mode: hold, toggle, hold to turn off, or always.
ui.button
A button. Each click runs its function on the next frame. It has no value, so nothing of it is saved.
Switched off
Off - switch it on to change these. A script that has never run shows: Its settings show here once it has run.

More in Lua scripts 4

Your own overlays in a few lines of Lua, with their own settings in the menu.