Skip to content

client

The client namespace provides core controls for registering callbacks, delayed execution, log printing, and self-managing script lifecycle.


client.add_callback(event: string, fn: function)

Registers an event callback function. See the Callbacks Guide for complete details and event signatures.

  • event: Name of the callback hook (e.g. "render", "createmove", "antiaim", "game_events", "aim_ack").
  • fn: The callback function to execute when the event fires.
client.add_callback("render", function()
-- Drawing logic here
end)

local removed = client.remove_callback(event: string, fn: function) --> boolean

Removes a previously registered callback matching the given function handle.

  • Returns true if a matching callback was found and removed; otherwise false.
  • Removing a callback during its own dispatch takes effect on the next event cycle.

client.delay_call(seconds: number, fn: function, ...)

Schedules a function to run after a specified monotonic wall-clock delay in seconds.

  • Timers persist across map changes and engine pauses.
  • Any arguments passed after fn are forwarded to the function upon execution.
  • Pending timers are automatically cancelled if the script unloads before execution.
client.delay_call(2.5, function(msg)
print("Delayed message: " .. msg)
end, "Hello after 2.5s")

client.unload_script()

Unloads the calling script instance.


client.reload_script()

Unloads and immediately reloads the calling script instance from disk.


client.color_log(r: number, g: number, b: number, ...)

Prints a colored log line to the cheat console with the specified RGB values (0..255).

  • Pass a trailing "\0" string argument to suppress the trailing newline, allowing multiple color_log calls to compose a single multicolored console line.
client.color_log(255, 100, 100, "Red prefix ", "\0")
client.color_log(100, 255, 100, "Green suffix\n")