Modules and configs
These tables change Citron itself: its modules and their settings, your configs, your Friend and Target Lists and your cosmetics. Every change goes into the config in use, the same as a change made in the Click GUI.
modules
Section titled “modules”modules.get(name) gives a module table, or nil when there is no such module. The name is the module’s id or its name, in any case, with or without spaces: "Auto Clicker", "autoclicker".
local clicker = modules.get("Auto Clicker")clicker:set("CPS", 10, 14)clicker:enable()print(clicker:enabled(), clicker:get("CPS"))A module table has id, name, description and category, and these methods:
| Method | What it does |
|---|---|
m:enabled() |
true if the module is on. m:isEnabled() is the same. |
m:enable(), m:disable() |
Switches it on, or off. |
m:toggle() |
Switches it the other way. |
m:setEnabled(on) |
Switches it on or off. |
m:get(setting) |
A setting’s value. See Setting values. |
m:set(setting, value) |
Changes a setting. Returns true when the change is saved. A value the setting cannot take is an error. |
m:settings() |
Every setting, as a list of tables (below). |
m:bind() |
The module’s key bind, or "" when it has none. |
m:setBind(key) |
Binds the module to a key. m:setBind("") clears the bind. |
m:reset() |
Puts every setting back to its default. |
The switching methods return true when the module ends up the way you asked. A module that cannot be switched stays as it is and gives false.
The same things work as plain functions that take the module’s name first. These raise an error for a name that is no module:
| Function | The same as |
|---|---|
modules.isEnabled(name) |
m:enabled() |
modules.enable(name), modules.disable(name), modules.toggle(name) |
m:enable(), m:disable(), m:toggle() |
modules.setEnabled(name, on) |
m:setEnabled(on) |
modules.setting(name, setting) |
m:get(setting) |
modules.set(name, setting, value) |
m:set(setting, value) |
modules.settings(name) |
m:settings() |
modules.bind(name), modules.setBind(name, key) |
m:bind(), m:setBind(key) |
modules.reset(name) |
m:reset() |
And to look through all of them:
| Function | Returns |
|---|---|
modules.list() |
The id of every module in the Click GUI. |
modules.all() |
Every module as a module table, with enabled and bind added. |
modules.enabledList() |
The ids of the modules that are on. |
modules.categories() |
The Click GUI’s categories, each {id, name, modules} where modules is a list of ids. |
Setting values
Section titled “Setting values”A setting is named by its key or by its label, in any case, with or without spaces: "FOV Cone" and "fov" are the same setting of AimAssist.
| Setting | get gives |
set takes |
|---|---|---|
| Slider | A number. | A number. |
| Range | Two numbers, low then high. | Two numbers, m:set("CPS", 10, 14), or a table, {10, 14}. One number sets both ends. |
| Toggle | true or false. |
true or false. |
| Choice | The selected option’s label. | An option’s label, "Silent", or its number counting from 1. |
| Colour | A number, 0xRRGGBB. |
Any colour. |
| Key | The key’s name. | A key’s name. |
| Text | A string. | A string. |
m:settings() gives one table per setting with key, label, type ("slider", "range", "check", "choice", "color", "key" or "text") and value. A range adds high, sliders and ranges add min, max and step, and a choice adds options, the list of its labels.
To see a module’s settings, print them to the console:
print(json.encode(modules.settings("AimAssist"), true))config
Section titled “config”| Function | What it does |
|---|---|
config.list() |
Returns the names of your configs. |
config.current() |
Returns the name of the config in use. |
config.load(name, quiet) |
Switches to another config. Returns true, or false and the reason. Shows a notification unless quiet is true. |
config.save() |
Writes changes to the config file now, instead of a moment later. |
config.create(name) |
Makes a config. Returns true, or false and the reason. |
server
Section titled “server”| Function | Returns |
|---|---|
server.name() |
The server’s name when Citron knows the server: "The Hive", "Zeqa". Otherwise "". |
server.is(name) |
true if you are on that server: the name matches, or the text is part of the address. server.is("zeqa"). |
server.address() |
The address of the server you are on, or "". |
server.ping() |
Your ping, in milliseconds. |
server.players() |
The names in the server’s player list. |
server.software() |
The name the server gives its software, when it gives one. |
server.world() |
The name the server gives its world. |
The join event passes this same table:
events.on("join", function(srv) if srv.is("The Hive") then config.load("Hive") endend)friends
Section titled “friends”Your Friend List and Target List, the same lists the combat modules use. See Who the combat modules go for.
| Function | What it does |
|---|---|
friends.isFriend(name) |
Returns true if name is on your Friend List. |
friends.isTarget(name) |
Returns true if name is on your Target List. |
friends.add(name), friends.remove(name) |
Adds a name to your Friend List, or removes it. |
friends.addTarget(name), friends.removeTarget(name) |
Adds a name to your Target List, or removes it. |
friends.list() |
Returns the names on your Friend List. |
friends.targets() |
Returns the names on your Target List. |
cosmetics
Section titled “cosmetics”Cosmetic slots are "hat", "back", "pet", "hands", "tail", "aura" and "neck".
| Function | What it does |
|---|---|
cosmetics.list(slot) |
Returns the id of every cosmetic for that slot, or of every cosmetic when you leave slot out. |
cosmetics.current() |
Returns what you wear, as a table from slot to cosmetic id: { hat = "...", pet = "..." }. |
cosmetics.wear(id) |
Wears a cosmetic in its slot. An id that is no cosmetic is an error. |
cosmetics.remove(slot) |
Takes off what you wear in a slot, or everything when you leave slot out. |
A cape is not one of these slots: wear one from the Cosmetics page, under Back.