Overview
The cheadle_api provides a wide range of Lua functions and tables that allow you to create hooks, draw shapes, manipulate game states, handle input, configure settings, debug, and more. This document outlines each function and table namespace, along with their parameters, return values, and descriptions.
Paths used by
RunFileare relative to%appdata%/cheadleware-v2/lua. Paths used byFile.*andDrawTextureare relative to%appdata%/cheadleware-v2/data.
Global Functions
The following functions are accessible directly under the cheadle_api table.
CreateHook
Syntax: cheadle_api.CreateHook(name, identifier, func)
- Parameters:
- Description: Registers a callback for a cheadle hook. See the Hooks section for the list of available hooks.
RemoveHook
Syntax: cheadle_api.RemoveHook(name, identifier)
- Parameters:
- Description: Removes a previously registered hook callback.
DrawRect
Syntax: cheadle_api.DrawRect(x, y, w, h, color, rounding = 0)
- Parameters:
- Description: Draws a filled rectangle. Must be called from a draw hook (
Paint,EngineDrawing,Player_DrawExtra, ImGui paint function, etc.).
DrawText
Syntax: cheadle_api.DrawText(x, y, text, color, align = 0, font = nil)
- Parameters:
- Description: Draws text at the given position.
DrawCircle
Syntax: cheadle_api.DrawCircle(x, y, radius, color, filled = false)
- Parameters:
- Description: Draws a circle.
DrawLine
Syntax: cheadle_api.DrawLine(x1, y1, x2, y2, color)
- Parameters:
- Description: Draws a line between two points.
DrawTexture
Syntax: cheadle_api.DrawTexture(texture_name, x, y, w, h)
- Parameters:
- Description: Draws a texture loaded from disk. Textures are cached after the first load.
BuildFont
Syntax: cheadle_api.BuildFont(title, path, size)
- Parameters:
- Description: Loads a font and registers it under the given title.
DrawExtra
Syntax: cheadle_api.DrawExtra(text, color, side, font = "Default", ignore_dormant = false)
- Parameters:
- Description: Adds an extra ESP line to the player or entity currently being drawn. Only valid inside the
Player_DrawExtraandEntity_DrawExtrahooks.
PushDarkRPVars
Syntax: cheadle_api.PushDarkRPVars()
- Description: Pushes the global DarkRPVars table onto the Lua stack.
getDarkRPVar
Syntax: cheadle_api.getDarkRPVar(ply, var_name)
- Parameters:
- Returns: The value of the requested var, or nil.
InviteFriend
Syntax: cheadle_api.InviteFriend(steamid64)
- Parameters:
steamid64(string): SteamID64 of the friend, decimal or0x-prefixed hex.
- Description: Sends a Steam invite to the given SteamID64.
SendAchievement
Syntax: cheadle_api.SendAchievement(achievement_id)
- Parameters:
achievement_id(number): The achievement ID.
- Description: Sends an
achievement_earnedmessage to the server.
BlockTraceEntity
Syntax: cheadle_api.BlockTraceEntity(entity)
- Parameters:
entity(Entity): Entity to add to the aimbot trace skip list.
- Description: Adds the entity to the autowall trace filter for this aimbot pass. Intended for use inside
Aimbot_IgnoreEntities. The skip list is cleared every aimbot tick.
BlockAimbotTarget
Syntax: cheadle_api.BlockAimbotTarget(entity)
- Parameters:
entity(Entity): Player entity to remove from the aimbot’s candidate list.
- Description: Adds the player to the aimbot target skip list for this tick. Intended for use inside
Aimbot_IgnoreEntities. The skip list is cleared every aimbot tick.
IsFreecamming
Syntax: cheadle_api.IsFreecamming()
- Returns:
boolean—trueif freecam is active.
FreecamPos
Syntax: cheadle_api.FreecamPos()
- Returns:
Vectorof the freecam position, ornilif freecam is not active.
FreecamAng
Syntax: cheadle_api.FreecamAng()
- Returns:
Angleof the freecam orientation, ornilif freecam is not active.
GetAimbotTarget
Syntax: cheadle_api.GetAimbotTarget()
- Returns: The current aimbot target Entity, or
nil.
GetTeamData
Syntax: cheadle_api.GetTeamData(team_id_or_entity)
- Parameters:
- Returns: A table
{ name = string, color = { r, g, b, a } }, ornilif the team is unknown.
Log
Syntax: cheadle_api.Log(message)
- Parameters:
message(string): Message to log.
- Description: Logs a message to the cheadle console.
Syntax: cheadle_api.Log(color, prefix, message)
- Parameters:
- Description: Logs a colored prefixed message to the console.
FindCFunction
Syntax: cheadle_api.FindCFunction(function_name)
Syntax: cheadle_api.FindCFunction(table_name, function_name)
- Parameters:
- Returns: The C function, or
nilif not found. - Description: Looks up a C function pointer from a Lua library or metatable.
Notification
Syntax: cheadle_api.Notification(message)
Syntax: cheadle_api.Notification(message, color, duration_ms)
- Parameters:
- Description: Displays an in-game notification.
RunFile
Syntax: cheadle_api.RunFile(file_path)
- Parameters:
file_path(string): Path relative to%appdata%/cheadleware-v2/lua.
- Description: Loads and runs a Lua file inside the cheadle environment.
RunString
Syntax: cheadle_api.RunString(code)
- Parameters:
code(string): Lua source to execute.
- Description: Executes Lua source inside the cheadle environment.
RichPresence
Syntax: cheadle_api.RichPresence(text)
- Parameters:
text(string): Rich presence string.
- Description: Updates Steam rich presence.
IsMenuOpen
Syntax: cheadle_api.IsMenuOpen()
- Returns:
boolean— whether the cheadle menu is open.
NewCClosure
Syntax: cheadle_api.NewCClosure(func)
- Parameters:
func(function): A Lua function.
- Returns: A C closure that, when called, forwards its arguments to
funcand returns its results. - Description: Wraps a Lua function in a C closure. Useful for code that distinguishes between Lua and C functions.
getrawmetatable
Syntax: cheadle_api.getrawmetatable(table)
- Parameters:
table(table): Any table.
- Returns: The table’s metatable, ignoring
__metatable, ornilif it has none.
OpenURL
Syntax: cheadle_api.OpenURL(url)
- Parameters:
url(string): URL to open.
- Description: Opens a URL in the user’s default browser.
GetEngineSpread
Syntax: cheadle_api.GetEngineSpread(cmd, spread)
- Parameters:
- Returns: An Angle representing the angular correction needed to compensate for engine spread on this command.
- Description: Computes the spread correction angle for
cmdbased on itscommand_number. Useful for nospread / silent-aim implementations.
GetRandomSpread
Syntax: cheadle_api.GetRandomSpread(cmd, seed)
- Parameters:
- Returns: Two numbers
(randX, randY)in roughly the range[-1, 1], representing the engine’s per-shot random spread offsets.
SetTickCount
Syntax: cheadle_api.SetTickCount(cmd, tick)
- Parameters:
- Description: Overwrites the command’s
tick_countfield.
SetCommandNumber
Syntax: cheadle_api.SetCommandNumber(cmd, number)
- Parameters:
GetRandomSeed
Syntax: cheadle_api.GetRandomSeed(cmd)
SetRandomSeed
Syntax: cheadle_api.SetRandomSeed(cmd, seed)
- Parameters:
- Description: Searches forward from
cmd.command_numberfor acommand_numberwhose derived seed matchesseed, then writes both fields. Used for seed-prediction exploits.
SetIsTyping
Syntax: cheadle_api.SetIsTyping(cmd, typing)
StartPrediction
Syntax: cheadle_api.StartPrediction(cmd)
- Parameters:
cmd(CUserCmd)
- Description: Begins an engine-prediction block for the given command. Pair with
FinishPrediction.
FinishPrediction
Syntax: cheadle_api.FinishPrediction()
- Description: Ends the engine-prediction block opened by
StartPrediction.
cheadle_api.Config
Manages cheadle configuration values, keybinds, colors, friend lists, and entity ESP whitelist.
The category argument is the config tab ("combat", "visuals", "ents", "misc", "exploits"). The feature argument is the in-cheat name of the option (e.g. "Chams").
GetBool
Syntax: cheadle_api.Config.GetBool(category, feature)
- Returns:
boolean, ornilif the option doesn’t exist.
SetBool
Syntax: cheadle_api.Config.SetBool(category, feature, value)
GetInt
Syntax: cheadle_api.Config.GetInt(category, feature)
- Returns:
number, ornil.
SetInt
Syntax: cheadle_api.Config.SetInt(category, feature, value)
GetFloat
Syntax: cheadle_api.Config.GetFloat(category, feature)
- Returns:
number, ornil.
SetFloat
Syntax: cheadle_api.Config.SetFloat(category, feature, value)
GetString
Syntax: cheadle_api.Config.GetString(category, feature)
- Returns:
string, ornil.
SetString
Syntax: cheadle_api.Config.SetString(category, feature, value)
GetColor
Syntax: cheadle_api.Config.GetColor(category, feature)
- Returns: A color table
{ r, g, b, a }, ornil.
SetColor
Syntax: cheadle_api.Config.SetColor(category, feature, value)
- Parameters:
valueis a color table.
GetKeybind
Syntax: cheadle_api.Config.GetKeybind(category, feature)
- Returns: A table
{ key = number, feature = string, mode = number }, ornil. - Description:
keyis a Windows virtual-key code (seeSetKeybindexample).
SetKeybind
Syntax: cheadle_api.Config.SetKeybind(category, feature, value)
-
Parameters:
value(table):{ key = number, mode = number }. Thefeaturefield is preserved by the cheat; onlykeyandmodeare read.
-
Example:
-- Uses Windows virtual-key codes, NOT Source ButtonCode_t.
-- https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
cheadle_api.Config.SetKeybind("exploits", "Speedhack Key", { key = 0x48 --[[ H ]], mode = 0 })
IsKeybindActive
Syntax: cheadle_api.Config.IsKeybindActive(category, feature)
- Returns:
boolean— whether the keybind is currently held / toggled active.
LoadConfig
Syntax: cheadle_api.Config.LoadConfig(name)
- Parameters:
name(string): Config file name to load from disk.
EntListSet
Syntax: cheadle_api.Config.EntListSet(entClass, enabled)
- Parameters:
GetFriendStatus
Syntax: cheadle_api.Config.GetFriendStatus(ply)
SetFriendStatus
Syntax: cheadle_api.Config.SetFriendStatus(ply, status)
cheadle_api.Input
Functions to simulate keyboard / mouse input through the engine’s input system.
ButtonDown
Syntax: cheadle_api.Input.ButtonDown(button_code)
- Parameters:
button_code(number): SourceButtonCode_t.
- Description: Simulates the button being pressed down.
ButtonUp
Syntax: cheadle_api.Input.ButtonUp(button_code)
- Parameters:
button_code(number): SourceButtonCode_t.
- Description: Simulates the button being released.
ButtonClick
Syntax: cheadle_api.Input.ButtonClick(button_code)
- Parameters:
button_code(number)
- Description: Simulates a press + release of the button.
MouseClick
Syntax: cheadle_api.Input.MouseClick(button)
- Parameters:
button(number):0left,1right,2middle, etc.
- Description: Simulates a mouse click.
ButtonToVirtual
Syntax: cheadle_api.Input.ButtonToVirtual(button_code)
- Parameters:
button_code(number): SourceButtonCode_t.
- Returns: The corresponding Windows virtual-key code.
VirtualToButton
Syntax: cheadle_api.Input.VirtualToButton(vk_code)
- Parameters:
vk_code(number): Windows virtual-key code.
- Returns: The corresponding Source
ButtonCode_t.
cheadle_api.debug
Debugging helpers.
GetRegistry
Syntax: cheadle_api.debug.GetRegistry()
- Returns: The Lua registry table.
- Description: Pushes the Lua registry (
LUA_REGISTRYINDEX) onto the stack so Lua can iterate or inspect it.
cheadle_api.GlobalVars
Read and write CGlobalVarsBase fields. All getters return numbers; all setters take a number.
GetAbsoluteFrametime / SetAbsoluteFrametime
Syntax:
cheadle_api.GlobalVars.GetAbsoluteFrametime()→numbercheadle_api.GlobalVars.SetAbsoluteFrametime(value)
GetCurtime / SetCurtime
Syntax:
cheadle_api.GlobalVars.GetCurtime()→numbercheadle_api.GlobalVars.SetCurtime(value)
GetFramecount / SetFramecount
Syntax:
cheadle_api.GlobalVars.GetFramecount()→numbercheadle_api.GlobalVars.SetFramecount(value)
GetFrametime / SetFrametime
Syntax:
cheadle_api.GlobalVars.GetFrametime()→numbercheadle_api.GlobalVars.SetFrametime(value)
GetInterpolationAmount / SetInterpolationAmount
Syntax:
cheadle_api.GlobalVars.GetInterpolationAmount()→numbercheadle_api.GlobalVars.SetInterpolationAmount(value)
GetIntervalPerTick / SetIntervalPerTick
Syntax:
cheadle_api.GlobalVars.GetIntervalPerTick()→numbercheadle_api.GlobalVars.SetIntervalPerTick(value)
GetMaxClients / SetMaxClients
Syntax:
cheadle_api.GlobalVars.GetMaxClients()→numbercheadle_api.GlobalVars.SetMaxClients(value)
GetNetworkProtocol / SetNetworkProtocol
Syntax:
cheadle_api.GlobalVars.GetNetworkProtocol()→numbercheadle_api.GlobalVars.SetNetworkProtocol(value)
GetRealtime / SetRealtime
Syntax:
cheadle_api.GlobalVars.GetRealtime()→numbercheadle_api.GlobalVars.SetRealtime(value)
GetSimTicksThisFrame / SetSimTicksThisFrame
Syntax:
cheadle_api.GlobalVars.GetSimTicksThisFrame()→numbercheadle_api.GlobalVars.SetSimTicksThisFrame(value)
GetTickcount / SetTickcount
Syntax:
cheadle_api.GlobalVars.GetTickcount()→numbercheadle_api.GlobalVars.SetTickcount(value)
cheadle_api.channel
Wrapper around INetChannelInfo / INetChannel for the active client connection. All getters return nil if there is no active channel.
The flow argument used by several functions is 0 for outgoing and 1 for incoming.
GetName
Syntax: cheadle_api.channel.GetName() → string
GetAddress
Syntax: cheadle_api.channel.GetAddress() → string
- Description: Remote IP and port.
GetTime / GetTimeConnected / GetTimeSinceLastReceived / GetTimeoutSeconds
Syntax:
cheadle_api.channel.GetTime()→numbercheadle_api.channel.GetTimeConnected()→numbercheadle_api.channel.GetTimeSinceLastReceived()→numbercheadle_api.channel.GetTimeoutSeconds()→number
GetBufferSize
Syntax: cheadle_api.channel.GetBufferSize() → number
GetDataRate / GetRate / SetRate
Syntax:
cheadle_api.channel.GetDataRate()→numbercheadle_api.channel.GetRate()→numbercheadle_api.channel.SetRate(rate)—ratein bytes per second.
IsLoopback / IsTimingOut / IsPlayback
Syntax:
cheadle_api.channel.IsLoopback()→booleancheadle_api.channel.IsTimingOut()→booleancheadle_api.channel.IsPlayback()→boolean
GetLatency / GetAvgLatency / GetAvgLoss / GetAvgChoke / GetAvgData / GetAvgPackets / GetTotalData
Syntax: cheadle_api.channel.<name>(flow) → number
- Parameters:
flow(number):0outgoing,1incoming.
GetSequenceNr
Syntax: cheadle_api.channel.GetSequenceNr(flow) → number
SetSequenceNr
Syntax: cheadle_api.channel.SetSequenceNr(value)
- Description: Overwrites
m_nOutSequenceNrdirectly.
IsValidPacket
Syntax: cheadle_api.channel.IsValidPacket(flow, frame_number) → boolean
GetPacketTime
Syntax: cheadle_api.channel.GetPacketTime(flow, frame_number) → number
GetCommandInterpolationAmount
Syntax: cheadle_api.channel.GetCommandInterpolationAmount(flow, frame_number) → number
GetBSendPacket / SetBSendPacket
Syntax:
cheadle_api.channel.GetBSendPacket()→booleancheadle_api.channel.SetBSendPacket(value)— disable to skip sending the next outgoing packet (clc_Move stop).
SendDatagram
Syntax: cheadle_api.channel.SendDatagram()
- Description: Forces an immediate datagram send.
SendNetStringCmd
Syntax: cheadle_api.channel.SendNetStringCmd(cmd)
- Parameters:
cmd(string): Server console command to send (forwarded asclc_StringCmd).
SetCVar
Syntax: cheadle_api.channel.SetCVar(name, value)
- Parameters:
cheadle_api.player
Reads player state directly from the entity. All functions take a player Entity.
GetAnimState
Syntax: cheadle_api.player.GetAnimState(entity)
- Returns: A table:
{
move_x = number,
move_y = number,
m_flEyeYaw = number,
m_flEyePitch = number,
m_flGoalFeetYaw = number,
m_flCurrentFeetYaw= number,
}
GetEyeYaw
Syntax: cheadle_api.player.GetEyeYaw(entity) → number
GetBaseVelocity
Syntax: cheadle_api.player.GetBaseVelocity(entity)
- Returns: A table
{ x, y, z }.
GetVelocity
Syntax: cheadle_api.player.GetVelocity(entity)
- Returns: A table
{ x, y, z }.
GetViewOffset
Syntax: cheadle_api.player.GetViewOffset(entity)
- Returns: A table
{ x, y, z }.
GetViewPunch / GetAimPunch
Syntax:
cheadle_api.player.GetViewPunch(entity)→{ pitch, yaw, roll }cheadle_api.player.GetAimPunch(entity)→{ pitch, yaw, roll }
GetTickBase
Syntax: cheadle_api.player.GetTickBase(entity) → number
GetSimulationTime
Syntax: cheadle_api.player.GetSimulationTime(entity) → number
GetFlags
Syntax: cheadle_api.player.GetFlags(entity) → number
- Description: Bit field of
EntityFlags.
HasFlag
Syntax: cheadle_api.player.HasFlag(entity, flag) → boolean
IsDucked / IsDucking / IsInDuckJump
Syntax: cheadle_api.player.<name>(entity) → boolean
GetDucktime / GetDuckJumpTime
Syntax: cheadle_api.player.<name>(entity) → number
GetAmmo
Syntax: cheadle_api.player.GetAmmo(entity) → number
- Description: Returns the player’s
m_iAmmo(raw count of the active ammo slot).
GetGroundEntity
Syntax: cheadle_api.player.GetGroundEntity(entity) → number
- Description: Returns the raw
EHANDLEvalue as a number. Compare against0for “not on the ground”.
GetFallVelocity
Syntax: cheadle_api.player.GetFallVelocity(entity) → number
GetTeamNum
Syntax: cheadle_api.player.GetTeamNum(entity) → number
GetMoveType
Syntax: cheadle_api.player.GetMoveType(entity) → number
GetHitboxSet
Syntax: cheadle_api.player.GetHitboxSet(entity) → number
IsDormant
Syntax: cheadle_api.player.IsDormant(entity) → boolean
GetInt / GetFloat / GetBool
Syntax: cheadle_api.player.Get<Type>(entity, netvar_name)
- Parameters:
netvar_name(string): Full netvar path (e.g."DT_BasePlayer.m_iHealth").
- Returns: The netvar value as the requested type, or
nilif unknown. - Description: Reads a netvar by name from the entity. Offsets are cached.
ListNetVars
Syntax: cheadle_api.player.ListNetVars() → table
- Returns: An array of every known netvar name. Takes no entity argument.
cheadle_api.timer
Tick-driven timers. Timers are cleared automatically when leaving a server.
Simple
Syntax: cheadle_api.timer.Simple(delay, func)
- Parameters:
- Description: Runs
funconce, afterdelayseconds.
Create
Syntax: cheadle_api.timer.Create(name, delay, repetitions, func)
- Parameters:
- Description: Creates a named recurring timer. Re-creating with the same name replaces it.
Exists
Syntax: cheadle_api.timer.Exists(name) → boolean
Remove
Syntax: cheadle_api.timer.Remove(name)
cheadle_api.File
File I/O sandboxed to %appdata%/cheadleware-v2/data. Path traversal is sanitized. Writable extensions are limited to .txt, .log, .json, .dat, .png, .jpeg, .jpg, .wav — Write silently ignores other extensions.
Read
Syntax: cheadle_api.File.Read(file_path) → string | nil
Write
Syntax: cheadle_api.File.Write(file_path, data)
- Description: Writes
datatofile_path. The path’s extension must be in the allow-list above.
MakeDir
Syntax: cheadle_api.File.MakeDir(path)
Delete
Syntax: cheadle_api.File.Delete(file_path)
RemoveDir
Syntax: cheadle_api.File.RemoveDir(path)
- Description: Recursively removes the directory.
FindFiles
Syntax: cheadle_api.File.FindFiles(path) → table | nil
- Returns: Array of file names in the directory, or
nilif the directory doesn’t exist.
FindDirectories
Syntax: cheadle_api.File.FindDirectories(path) → table | nil
- Returns: Array of directory names, or
nil.
cheadle_api.Draw
Mirror of the top-level draw functions, kept under a Draw table for callers that want a namespace. All functions behave identically to their top-level counterparts.
| Function | Same as |
|---|---|
cheadle_api.Draw.DrawRect(...) | DrawRect |
cheadle_api.Draw.DrawText(...) | DrawText |
cheadle_api.Draw.DrawCircle(...) | DrawCircle |
cheadle_api.Draw.DrawLine(...) | DrawLine |
cheadle_api.Draw.DrawTexture(...) | DrawTexture |
cheadle_api.Draw.BuildFont(...) | BuildFont |
cheadle_api.Draw.DrawExtra(...) | DrawExtra |
GetTextSize
Syntax: cheadle_api.Draw.GetTextSize(text, font = nil)
- Parameters:
- Returns: Two numbers
(width, height)in pixels.
cheadle_api.HTTP
Asynchronous HTTP client built on libcurl. All callbacks run on the main Lua thread once the request finishes — they receive the response body as a single string argument.
Only one in-flight request at a time has its callback delivered. If multiple requests finish back-to-back, only the most recent one fires its callback.
Get
Syntax:
-
cheadle_api.HTTP.Get(url, callback) -
cheadle_api.HTTP.Get(url, headers, callback) -
Parameters:
Post
Syntax: cheadle_api.HTTP.Post(url, type, params, headers, callback)
- Parameters:
Put
Syntax: cheadle_api.HTTP.Put(url, data, headers, callback)
- Parameters:
cheadle_api.pathfinder
Controls the built-in A* movement bot. The pathfinder runs on a worker thread and replays its plan tick-by-tick into the player’s cmd.
SetTarget
Syntax:
-
cheadle_api.pathfinder.SetTarget(vector) -
cheadle_api.pathfinder.SetTarget(x, y, z) -
Description: Sets a destination and queues a replan.
SetTargetToCrosshair
Syntax: cheadle_api.pathfinder.SetTargetToCrosshair()
- Description: Targets the world point under the player’s crosshair.
ClearTarget
Syntax: cheadle_api.pathfinder.ClearTarget()
Replan
Syntax: cheadle_api.pathfinder.Replan()
- Description: Forces an immediate replan from the current position.
GetTarget
Syntax: cheadle_api.pathfinder.GetTarget() → Vector | nil
HasTarget
Syntax: cheadle_api.pathfinder.HasTarget() → boolean
IsPlaybackActive
Syntax: cheadle_api.pathfinder.IsPlaybackActive() → boolean
IsPlanning
Syntax: cheadle_api.pathfinder.IsPlanning() → boolean
- Description: True if a replan is queued, in flight, or waiting for the player to settle.
PlanFailed
Syntax: cheadle_api.pathfinder.PlanFailed() → boolean
- Description: True if the most recent plan failed to find a route.
GetExpansions
Syntax: cheadle_api.pathfinder.GetExpansions() → number
- Description: Number of A* node expansions in the most recent plan.
GetPlanSize
Syntax: cheadle_api.pathfinder.GetPlanSize() → number
GetPlaybackIndex
Syntax: cheadle_api.pathfinder.GetPlaybackIndex() → number
- Description: 1-based index of the currently-playing tick.
GetPlanTick
Syntax: cheadle_api.pathfinder.GetPlanTick(index)
- Parameters:
index(number): 1-based tick index.
- Returns: A table:
{
startPos = Vector,
startVel = Vector,
startOnGround = boolean,
viewAngles = Angle,
forward = number,
side = number,
pressJump = boolean,
buttons = number,
endPos = Vector,
endVel = Vector,
endOnGround = boolean,
}
GetPlan
Syntax: cheadle_api.pathfinder.GetPlan() → table
- Returns: 1-indexed array of tick tables (same shape as
GetPlanTick).
IsEnabled / SetEnabled
Syntax:
cheadle_api.pathfinder.IsEnabled()→booleancheadle_api.pathfinder.SetEnabled(enabled)
IsAutoWalkEnabled / SetAutoWalk
Syntax:
cheadle_api.pathfinder.IsAutoWalkEnabled()→booleancheadle_api.pathfinder.SetAutoWalk(enabled)
cheadle_api.movement_sim
Lua entry points to the threaded movement simulator. All three sim functions take a params table; missing fields fall back to live player state. CreateInput builds a populated params table to start from.
The params table accepts:
| Field | Type | Default |
|---|---|---|
origin | Vector | local player abs origin |
velocity | Vector | local player velocity |
angles | Angle | view angles |
grounded | boolean | FL_ONGROUND flag |
forward | number | 0 |
side | number | 0 |
buttons | number | 0 |
oldButtons | number | 0 |
maxSpeed | number | engine value |
deltaTime | number | tick interval |
gravity | number | sv_gravity |
currentGravity | number | engine value |
jumpPower | number | engine value |
yawDelta | number | 0 (used by Strafe) |
maxSpeedLoss | number | FLT_MAX |
timeUntilTimeout | number | 0 (used by Strafe) |
surfaceFriction | number | engine value |
sandboxAccel | boolean | engine value |
CreateInput
Syntax: cheadle_api.movement_sim.CreateInput() → table | nil
- Returns: A
paramstable populated from live player state, ready to be tweaked and passed back into the other sim functions.
SimulateTick
Syntax: cheadle_api.movement_sim.SimulateTick(params) → table | nil
- Returns: A single output table:
{
origin = Vector,
velocity = Vector,
angles = Angle,
grounded = boolean,
}
- Description: Runs one tick of
PartialProcessMovementwith the given inputs.
Simulate
Syntax: cheadle_api.movement_sim.Simulate(params, ticks = 1) → table
- Parameters:
ticks(number, optional): Number of ticks (clamped to[0, 10000]).
- Returns: 1-indexed array of output tables (same shape as
SimulateTick). - Description: Repeatedly steps the simulator with the same inputs.
IN_JUMPis edge-latched between ticks (held jump only fires the first tick), matching engine behaviour.
Strafe
Syntax: cheadle_api.movement_sim.Strafe(params) → table
- Description: Runs the auto-bhop circle-strafe job. Expects
params.yawDelta(degrees per tick) andparams.timeUntilTimeout(seconds of sim time). Side move and buttons are overridden internally. - Returns: 1-indexed array of
{ origin = Vector, velocity = Vector, timeRemaining = number }.
cheadle_api.ImGui
Custom ImGui windows controllable from Lua. Widgets are added to a parent Menu and respond via OnChangeFunction / SetClickFunction callbacks.
Menu
Syntax: cheadle_api.ImGui.Menu(name, window_flags = 0)
-
Parameters:
-
Returns: A menu object.
-
Methods:
Menu:SetPos(x, y)Menu:SetSize(w, h)Menu:Close()Menu:ShouldDraw(bool)— toggles visibility.Menu:PaintFunction(function)— runs every frame inside the window; can callcheadle_api.DrawRect/etc. to draw into the window.
-
Example:
local menu = cheadle_api.ImGui.Menu("Example Menu", 0)
menu:SetSize(400, 230)
menu:SetPos(100, 100)
local button = cheadle_api.ImGui.Button(menu, "Close")
button:SetSize(55, 30)
button:SetPos(10, 190)
button:SetClickFunction(function() menu:Close() end)
local checkbox = cheadle_api.ImGui.Checkbox(menu, "sample checkbox")
checkbox:SetPos(10, 35)
checkbox:OnChangeFunction(function()
cheadle_api.Log("Checkbox toggled: " .. tostring(checkbox:GetChecked()))
end)
local dropdown = cheadle_api.ImGui.Dropdown(menu, "sample dropdown", { "option1", "option2" })
dropdown:SetPos(10, 70)
dropdown:OnChangeFunction(function()
cheadle_api.Log("Dropdown: " .. dropdown:GetValue())
end)
local slider = cheadle_api.ImGui.Slider(menu, "sample slider", 0, 10)
slider:SetPos(10, 110)
slider:OnChangeFunction(function()
cheadle_api.Log("Slider: " .. slider:GetValue())
end)
local textbox = cheadle_api.ImGui.Textbox(menu, "sample textbox")
textbox:SetPos(10, 150)
textbox:OnChangeFunction(function()
cheadle_api.Log("Textbox: " .. textbox:GetValue())
end)
Checkbox
Syntax: cheadle_api.ImGui.Checkbox(parent, name)
- Parameters:
- Methods:
Checkbox:SetPos(x, y)Checkbox:GetChecked()→booleanCheckbox:SetChecked(bool)Checkbox:OnChangeFunction(callback)
Button
Syntax: cheadle_api.ImGui.Button(parent, name)
- Methods:
Button:SetPos(x, y)Button:SetSize(w, h)Button:SetClickFunction(callback)
Slider
Syntax: cheadle_api.ImGui.Slider(parent, name, min, max, format = "%d")
- Parameters:
- Methods:
Slider:SetPos(x, y)Slider:SetSize(w, h)Slider:GetValue()→numberSlider:SetValue(number)Slider:OnChangeFunction(callback)
Textbox
Syntax: cheadle_api.ImGui.Textbox(parent, name)
- Methods:
Textbox:SetPos(x, y)Textbox:SetSize(w, h)Textbox:GetValue()→stringTextbox:SetValue(string)Textbox:OnChangeFunction(callback)
Dropdown
Syntax: cheadle_api.ImGui.Dropdown(parent, name, options)
- Parameters:
options(table): Array of strings.
- Methods:
Dropdown:SetPos(x, y)Dropdown:SetSize(w, h)Dropdown:GetValue()→string— the selected option.Dropdown:SetValue(string)— select an option by its label.Dropdown:OnChangeFunction(callback)
Colorpicker
Syntax: cheadle_api.ImGui.Colorpicker(parent, name)
- Methods:
Colorpicker:SetPos(x, y)Colorpicker:GetValue()→ color table{ r, g, b, a }Colorpicker:SetValue(color_table)Colorpicker:OnChangeFunction(callback)
Hooks
The cheadle_api exposes a hook system that lets you listen to internal cheat events. You can also listen to standard Garry’s Mod hooks (except those fired purely from Lua) by name.
Hook callbacks return values where noted; otherwise the return value is ignored.
Paint
- Description: Runs every frame on the engine’s
Paintevent. Use the top-levelDrawRect/DrawText/etc. to draw to the screen.
cheadle_api.CreateHook("Paint", "id", function()
cheadle_api.DrawRect(10, 10, 100, 100, { r = 255, g = 0, b = 0 })
end)
PaintTraverse
- Description: Same as
Paint. Kept for backwards compatibility.
EngineDrawing
- Description: Lets Lua draw into the steam overlay. You can use regular
surface.*andcam.*functions.
cheadle_api.CreateHook("EngineDrawing", "id", function()
cam.Start2D()
surface.SetDrawColor(255, 0, 0, 255)
surface.DrawRect(260, 260, 100, 30)
cam.End2D()
end)
Pre_PreSend
- Parameters:
cmd(CUserCmd)
- Description: Fires immediately before the cheat processes its outgoing
CreateMovework. Use this when you want to modify the command before silent aim, nospread, etc. Predicted if engine prediction is enabled — be careful with movement edits.
cheadle_api.CreateHook("Pre_PreSend", "id", function(cmd)
-- modify cmd
end)
Post_PreSend
- Parameters:
cmd(CUserCmd)
- Description: Fires after the cheat’s outgoing processing (silent aim / nospread / etc.) but before the packet is sent. Use this as the canonical override point for your own movement / aim work. Predicted if engine prediction is enabled.
Pre_FreecamRender
- Parameters:
- Returns:
(Vector, Angle)— the position and angle to actually render the freecam from. Returning anything else (including a single value ornil) leaves the freecam render unchanged. - Description: Fires every frame the freecam is active, before the freecam scene render. Lets Lua transform the freecam pose without replacing the freecam itself — input handling and the underlying position are untouched.
cheadle_api.CreateHook("Pre_FreecamRender", "orbit", function(pos, ang)
local target = cheadle_api.GetAimbotTarget()
if not target then return end
local origin = target:GetPos() + Vector(0, 0, 60)
local newPos = origin + Vector(math.cos(CurTime()), math.sin(CurTime()), 0) * 80
local newAng = (origin - newPos):Angle()
return newPos, newAng
end)
Net_Receive
- Parameters:
name(string): Net message name.
- Description: Fires before
net.Incomingruns the server’s net message, so you can observe (but not modify) incoming traffic before regular Lua sees it.
Net_ShouldSend
- Parameters:
name(string): Name of the outgoing net message (resolved fromg_Write).
- Returns: Return
falseto block the call tonet.SendToServer().
cheadle_api.CreateHook("Net_ShouldSend", "id", function(name)
if name == "bad_ac_example" then return false end
end)
SendNetMsg
- Parameters:
- Returns: Return
trueto drop the message. Fires on every Source-levelINetChannel::SendNetMsg.
Aimbot_IgnoreEntities
- Description: Fires once per aimbot pass, before targets are filtered. Call
BlockTraceEntityand / orBlockAimbotTargetto add entries to the aimbot skip lists. The lists are cleared at the start of every pass.
cheadle_api.CreateHook("Aimbot_IgnoreEntities", "id", function()
local tr = LocalPlayer():GetEyeTrace()
local ent = tr.Entity
if IsValid(ent) then
cheadle_api.BlockTraceEntity(ent)
if ent:IsPlayer() then
cheadle_api.BlockAimbotTarget(ent)
end
end
end)
ESP_ShouldDrawEntity
- Parameters:
ent(Entity)
- Returns: Return
falseto skip drawing this entity.
ESP_ShouldDrawPlayer
- Parameters:
ent(Entity)
- Returns: Return
falseto skip drawing this player.
ESP_PlayerName
- Parameters:
ent(Player)
- Returns: Return a string to override the player’s displayed name on the ESP.
ESP_PlayerUsergroup
- Parameters:
ent(Player)
- Returns: Return a string to override the displayed usergroup on the ESP.
Entity_DrawExtra
- Parameters:
ent(Entity)
- Description: Fires after the entity’s main ESP draw. Inside this hook,
DrawExtraattaches lines to this entity.
Player_DrawExtra
- Parameters:
ent(Entity)
- Description: Fires after the player’s main ESP draw. Inside this hook,
DrawExtraattaches lines to this player.
Pre_AnimUpdate
- Parameters:
ent(Entity)
- Description: Fires before the cheat’s own animation-state update for an entity. Use it to read or modify pose parameters and animation layers.
Pre_BuildBones
- Parameters:
ent(Entity)
- Description: Fires before the cheat’s bone build for an entity. Pose parameters and render angles can be set here for resolver work; they will be reset after the bones build, so this does not permanently modify the entity.
cheadle_api.CreateHook("Pre_BuildBones", "weird-roll-resolver", function(ply)
local eyeAngles = ply:EyeAngles()
if math.abs(eyeAngles[3]) == 180 then
ply:SetPoseParameter("aim_pitch", -eyeAngles[1])
ply:SetRenderAngles(Angle(0, math.NormalizeAngle(eyeAngles[2] - 180), 0))
end
end)
Pre_NoSpread
- Parameters:
cmd(CUserCmd)
- Returns: Return
falseto skip the cheat’s nospread handling for this tick.
KeyPressed
- Parameters:
button(number): SourceButtonCode_t(usecheadle_api.Input.ButtonToVirtualto convert to a Windows VK).
- Description: Fires when a key is pressed via the engine input system. Suppressed while the freecam is active or while a cheat keybind is consuming the key.
KeyReleased
- Parameters:
button(number): SourceButtonCode_t.
- Description: Fires when a key is released. Same suppression rules as
KeyPressed.
PreventKey
- Parameters:
button(number): SourceButtonCode_t.
- Returns: Return
trueto swallow the press / release before the engine sees it. Any other return value passes the input through. - Description: Fires alongside
KeyPressedandKeyReleased.
Key_Change
- Parameters:
- Description: Fires once per state change, polled from
GetAsyncKeyStatefor keys0x01..0xFE. UnlikeKeyPressed, it is not gated by the engine input system, so it fires even when the cheat menu is consuming input.
cheadle_api.CreateHook("Key_Change", "id", function(vk, down)
cheadle_api.Log(input.GetKeyName(cheadle_api.Input.VirtualToButton(vk)) .. " " .. tostring(down))
end)