### Create ImGui Menu using Cheadle API Source: https://cheadleware.net/api/index Creates an ImGui menu with customizable elements. It accepts a menu name and window flags. The menu can be resized, repositioned, and its visibility controlled. Example demonstrates adding buttons, checkboxes, dropdowns, sliders, and textboxes. ```lua 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: " .. (checkbox:GetChecked() and "true" or "false")) end) local dropdown = cheadle_api.ImGui.Dropdown(menu, "sample dropdown", {"option1", "option2"}) dropdown:SetPos(10, 70) dropdown:OnChangeFunction(function() cheadle_api.Log("Dropdown option selected: " .. dropdown:GetSelected()) end) local slider = cheadle_api.ImGui.Slider(menu, "sample slider", 0, 10) slider:SetPos(10, 110) slider:OnChangeFunction(function() cheadle_api.Log("Slider changed: " .. slider:GetValue()) end) local textbox = cheadle_api.ImGui.Textbox(menu, "sample textbox") textbox:SetPos(10, 150) textbox:OnChangeFunction(function() cheadle_api.Log("Textbox changed: " .. textbox:GetText()) end) ``` -------------------------------- ### ImGui Checkbox API Source: https://cheadleware.net/api/index API for creating and managing ImGui checkboxes. Allows setting and getting the checked state and defining callback functions. ```APIDOC ## ImGui Checkbox ### Description Creates an ImGui Checkbox. ### Syntax `cheadle_api.ImGui.Checkbox(parent, name)` ### Parameters #### Path Parameters * **parent** (ImGuiMenu) - Required - In which Menu this element should be parented to. * **name** (string) - Required - Name of this Checkbox. ### Request Example ```lua local menu = cheadle_api.ImGui.Menu("Example Menu", 0) menu:SetSize(400, 230) menu:SetPos(100, 100) local checkbox = cheadle_api.ImGui.Checkbox(menu, "sample checkbox") checkbox:SetPos(10, 35) checkbox:OnChangeFunction(function() cheadle_api.Log("Checkbox toggled: " .. (checkbox:GetChecked() and "true" or "false")) end) ``` ### Methods * `Checkbox:GetChecked(): boolean` * `Checkbox:SetChecked(bool checked)` * `Checkbox:SetPos(number x, number y)` * `Checkbox:OnChangeFunction(function callback)` ``` -------------------------------- ### Set Keybind Configuration (Cheadle API) Source: https://cheadleware.net/api/index Sets a keybind configuration. It requires the module and feature name (both strings), and a table containing the keybind details. Note that this uses Windows virtual key codes, not Source Engine button codes. An example is provided for setting the 'H' key for a 'Speedhack Key' in the 'exploits' module. ```lua -- IT USES WINDOWS VIRTUAL KEY CODES, NOT BUTTONCODE_T FROM SOURCE ENGINE -- https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes cheadle_api.SetKeybind("exploits", "Speedhack Key", { key = 0x48 --[[ 0x48 = H ]] }) cheadle_api.Config.SetKeybind("exploits", "Speedhack Key", { key = 0x48 --[[ 0x48 = H ]] }) ``` -------------------------------- ### ImGui Textbox API Source: https://cheadleware.net/api/index Documentation for creating and managing ImGui Textbox elements. ```APIDOC ## ImGui Textbox ### Description Creates an ImGui Textbox for text input. ### Syntax `cheadle_api.ImGui.Textbox(parent, name)` ### Parameters #### Path Parameters - `parent` (ImGuiMenu) - Required - The menu this textbox will be parented to. - `name` (string) - Required - The name of the textbox. ### Methods - `Textbox:GetText(): string` - Returns the current text in the textbox. - `Textbox:SetText(string value)` - Sets the text in the textbox. - `Textbox:SetSize(number width, number height)` - Sets the size of the textbox. - `Textbox:SetPos(number x, number y)` - Sets the position of the textbox. - `Textbox:OnChangeFunction(function callback)` - Registers a callback function to be executed when the text changes. ### Request Example ```lua local menu = cheadle_api.ImGui.Menu("Example Menu", 0) menu:SetSize(400, 230) menu:SetPos(100, 100) local textbox = cheadle_api.ImGui.Textbox(menu, "sample textbox") textbox:SetPos(10, 35) textbox:OnChangeFunction(function() cheadle_api.Log("Textbox changed: " .. textbox:GetText()) end) ``` ``` -------------------------------- ### Get Current Time (Cheadle GlobalVars API) Source: https://cheadleware.net/api/index Retrieves the current in-game time. This function returns a number representing the elapsed time since the game started. It is part of the `cheadle_api.GlobalVars` table. ```lua cheadle_api.GlobalVars.GetCurtime() ``` -------------------------------- ### ImGui Dropdown API Source: https://cheadleware.net/api/index Documentation for creating and managing ImGui Dropdown elements. ```APIDOC ## ImGui Dropdown ### Description Creates an ImGui Dropdown menu with specified options. ### Syntax `cheadle_api.ImGui.Dropdown(parent, name, options)` ### Parameters #### Path Parameters - `parent` (ImGuiMenu) - Required - The menu this dropdown will be parented to. - `name` (string) - Required - The name of the dropdown. - `options` (table) - Required - A table of strings representing the dropdown options. ### Methods - `Dropdown:GetSelected(): string` - Returns the currently selected option. - `Dropdown:SetSelected(string value)` - Sets the selected option. - `Dropdown:SetSize(number width, number height)` - Sets the size of the dropdown. - `Dropdown:SetPos(number x, number y)` - Sets the position of the dropdown. - `Dropdown:OnChangeFunction(function callback)` - Registers a callback function to be executed when the selection changes. ### Request Example ```lua local menu = cheadle_api.ImGui.Menu("Example Menu", 0) menu:SetSize(400, 230) menu:SetPos(100, 100) local dropdown = cheadle_api.ImGui.Dropdown(menu, "sample dropdown", {"option1", "option2"}) dropdown:SetPos(10, 35) dropdown:OnChangeFunction(function() cheadle_api.Log("Dropdown changed: " .. dropdown:GetSelected()) end) ``` ``` -------------------------------- ### Get Absolute Frametime (Cheadle GlobalVars API) Source: https://cheadleware.net/api/index Retrieves the absolute frametime of the game. This function returns a number representing the time taken for the current frame. It is part of the `cheadle_api.GlobalVars` table. ```lua cheadle_api.GlobalVars.GetAbsoluteFrametime() ``` -------------------------------- ### ImGui Menu API Source: https://cheadleware.net/api/index API for creating and managing ImGui menus. Allows customization of size, position, and content. ```APIDOC ## ImGui Menu ### Description Creates an ImGui menu. You can add custom elements to it for custom menus. ### Syntax `cheadle_api.ImGui.Menu(name, window_flags)` ### Parameters #### Path Parameters * **name** (string) - Required - Name of the Menu. * **window_flags** (number) - Required - ImGui Byteflag for Window. ### Request Example ```lua 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: " .. (checkbox:GetChecked() and "true" or "false")) end) local dropdown = cheadle_api.ImGui.Dropdown(menu, "sample dropdown", {"option1", "option2"}) dropdown:SetPos(10, 70) dropdown:OnChangeFunction(function() cheadle_api.Log("Dropdown option selected: " .. dropdown:GetSelected()) end) local slider = cheadle_api.ImGui.Slider(menu, "sample slider", 0, 10) slider:SetPos(10, 110) slider:OnChangeFunction(function() cheadle_api.Log("Slider changed: " .. slider:GetValue()) end) local textbox = cheadle_api.ImGui.Textbox(menu, "sample textbox") textbox:SetPos(10, 150) textbox:OnChangeFunction(function() cheadle_api.Log("Textbox changed: " .. textbox:GetText()) end) ``` ### Methods * `Menu:Close()` * `Menu:SetSize(number width, number height)` * `Menu:SetPos(number x, number y)` * `Menu:ShouldDraw(bool draw)` ``` -------------------------------- ### ImGui API Source: https://cheadleware.net/api/index Provides functions for creating menus and elements within the ImGui interface. ```APIDOC ## ImGui API The `cheadle_api.ImGui` table provides functions for creating menus and elements in ImGui. *(Specific functions for ImGui are not detailed in the provided text)* ``` -------------------------------- ### RunFile Source: https://cheadleware.net/api/index Executes the Lua code from the specified file. ```APIDOC ## RunFile ### Description Executes the Lua code from the specified file. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```lua cheadle_api.RunFile("my_script.lua") ``` ### Response #### Success Response (200) None #### Response Example None ### Parameters Details - **file_path** (string): The path to the Lua file to execute. Relative to `%appdata%/cheadleware-v2/lua`. ``` -------------------------------- ### Configuration Management Source: https://cheadleware.net/api/index Functions for managing and retrieving configuration values, including booleans, colors, numbers, keybinds, and strings. ```APIDOC ## cheadle_api.Config.EntListSet ### Description Sets whether an entity class is enabled on the ESP. ### Method POST ### Endpoint `/cheadle_api/Config/EntListSet` ### Parameters #### Query Parameters None #### Request Body - **entClass** (string) - Required - The entity class to set. - **enabled** (boolean) - Required - Whether to enable or disable the entity class. ### Request Example ```json { "entClass": "player", "enabled": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Config.GetBool ### Description Retrieves a boolean configuration value. ### Method GET ### Endpoint `/cheadle_api/Config/GetBool` ### Parameters #### Query Parameters - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **value** (boolean) - The boolean configuration value. #### Response Example ```json { "value": true } ``` ## cheadle_api.Config.GetColor ### Description Retrieves a color configuration value. ### Method GET ### Endpoint `/cheadle_api/Config/GetColor` ### Parameters #### Query Parameters - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **value** (object) - The color configuration value. Example: `{"r": 255, "g": 0, "b": 0, "a": 255} #### Response Example ```json { "value": { "r": 255, "g": 0, "b": 0, "a": 255 } } ``` ## cheadle_api.Config.GetFloat ### Description Retrieves a float configuration value. ### Method GET ### Endpoint `/cheadle_api/Config/GetFloat` ### Parameters #### Query Parameters - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **value** (number) - The float configuration value. #### Response Example ```json { "value": 1.5 } ``` ## cheadle_api.Config.GetInt ### Description Retrieves an integer configuration value. ### Method GET ### Endpoint `/cheadle_api/Config/GetInt` ### Parameters #### Query Parameters - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **value** (integer) - The integer configuration value. #### Response Example ```json { "value": 10 } ``` ## cheadle_api.Config.GetKeybind ### Description Retrieves a keybind configuration value. ### Method GET ### Endpoint `/cheadle_api/Config/GetKeybind` ### Parameters #### Query Parameters - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **value** (object) - The keybind configuration value. Example: `{"key": 72}` #### Response Example ```json { "value": { "key": 72 } } ``` ## cheadle_api.Config.GetString ### Description Retrieves a string configuration value. ### Method GET ### Endpoint `/cheadle_api/Config/GetString` ### Parameters #### Query Parameters - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **value** (string) - The string configuration value. #### Response Example ```json { "value": "example_string" } ``` ## cheadle_api.Config.GetFriendStatus ### Description Retrieves the friend status of a player. ### Method GET ### Endpoint `/cheadle_api/Config/GetFriendStatus` ### Parameters #### Query Parameters - **ply** (Player) - Required - The player entity. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **status** (number) - The friend status: `0` - Neutral, `1` - Friend, `2` - Enemy. #### Response Example ```json { "status": 1 } ``` ## cheadle_api.Config.SetBool ### Description Sets a boolean configuration value. ### Method POST ### Endpoint `/cheadle_api/Config/SetBool` ### Parameters #### Query Parameters None #### Request Body - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. - **value** (boolean) - Required - The boolean value to set. ### Request Example ```json { "module": "visuals", "feature": "Chams", "value": false } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Config.SetColor ### Description Sets a color configuration value. ### Method POST ### Endpoint `/cheadle_api/Config/SetColor` ### Parameters #### Query Parameters None #### Request Body - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. - **value** (object) - Required - The color value to set. Example: `{"r": 255, "g": 0, "b": 0, "a": 255} ### Request Example ```json { "module": "visuals", "feature": "ChamsColor", "value": { "r": 255, "g": 255, "b": 0, "a": 255 } } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Config.SetFloat ### Description Sets a float configuration value. ### Method POST ### Endpoint `/cheadle_api/Config/SetFloat` ### Parameters #### Query Parameters None #### Request Body - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. - **value** (number) - Required - The float value to set. ### Request Example ```json { "module": "visuals", "feature": "ChamsAlpha", "value": 0.8 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Config.SetInt ### Description Sets an integer configuration value. ### Method POST ### Endpoint `/cheadle_api/Config/SetInt` ### Parameters #### Query Parameters None #### Request Body - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. - **value** (integer) - Required - The integer value to set. ### Request Example ```json { "module": "player", "feature": "Health", "value": 100 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Config.SetKeybind ### Description Sets a keybind configuration value. ### Method POST ### Endpoint `/cheadle_api/Config/SetKeybind` ### Parameters #### Query Parameters None #### Request Body - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. - **value** (object) - Required - The keybind value to set. Example: `{"key": 72}` (Windows Virtual Key Code for H). ### Request Example ```json { "module": "exploits", "feature": "Speedhack Key", "value": { "key": 72 } } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Config.SetString ### Description Sets a string configuration value. ### Method POST ### Endpoint `/cheadle_api/Config/SetString` ### Parameters #### Query Parameters None #### Request Body - **module** (string) - Required - The module of the configuration. - **feature** (string) - Required - The feature of the configuration. - **value** (string) - Required - The string value to set. ### Request Example ```json { "module": "visuals", "feature": "Name", "value": "PlayerName" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Config.SetFriendStatus ### Description Sets the friend status of an entity. ### Method POST ### Endpoint `/cheadle_api/Config/SetFriendStatus` ### Parameters #### Query Parameters None #### Request Body - **ent** (Entity) - Required - The entity to set the status for. - **value** (number) - Required - The friend status: `0` - Neutral, `1` - Friend, `2` - Enemy. ### Request Example ```json { "ent": "entity_id_or_reference", "value": 1 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Create ImGui Textbox Source: https://cheadleware.net/api/index Creates an ImGui Textbox element within a specified menu. It allows users to input text and provides callbacks for when the text changes. Dependencies include the ImGui library and a parent ImGuiMenu object. ```lua local menu = cheadle_api.ImGui.Menu("Example Menu", 0) menu:SetSize(400, 230) menu:SetPos(100, 100) local textbox = cheadle_api.ImGui.Textbox(menu, "sample textbox") textbox:SetPos(10, 35) textbox:OnChangeFunction(function() cheadle_api.Log("Textbox changed: " .. textbox:GetText()) end) ``` -------------------------------- ### Create ImGui Dropdown Source: https://cheadleware.net/api/index Creates an ImGui Dropdown element within a specified menu. It allows for options to be set and provides callbacks for when the selection changes. Dependencies include the ImGui library and a parent ImGuiMenu object. ```lua local menu = cheadle_api.ImGui.Menu("Example Menu", 0) menu:SetSize(400, 230) menu:SetPos(100, 100) local dropdown = cheadle_api.ImGui.Dropdown(menu, "sample dropdown", {"option1", "option2"}) dropdown:SetPos(10, 35) dropdown:OnChangeFunction(function() cheadle_api.Log("Dropdown changed: " .. dropdown:GetSelected()) end) ``` -------------------------------- ### ImGui Button API Source: https://cheadleware.net/api/index API for creating and managing ImGui buttons. Allows setting text, size, position, and defining callback functions for click events. ```APIDOC ## ImGui Button ### Description Creates an ImGui Button. ### Syntax `cheadle_api.ImGui.Button(parent, name)` ### Parameters #### Path Parameters * **parent** (ImGuiMenu) - Required - In which Menu this element should be parented to. * **name** (string) - Required - Name of this Button. ### Request Example ```lua local menu = cheadle_api.ImGui.Menu("Example Menu", 0) menu:SetSize(400, 230) menu:SetPos(100, 100) local button = cheadle_api.ImGui.Button(menu, "sample button") button:SetSize(130, 25) button:SetPos(10, 35) button:SetClickFunction(function() cheadle_api.Log("Button clicked") end) ``` ### Methods * `Button:SetText(string text)` * `Button:SetSize(number width, number height)` * `Button:SetPos(number x, number y)` * `Button:SetClickFunction(function callback)` ``` -------------------------------- ### Create ImGui Slider using Cheadle API Source: https://cheadleware.net/api/index Creates an ImGui Slider with a specified name, minimum, and maximum value, parented to a given menu. It allows users to select a value within a range. Callbacks can be set for value changes. Includes methods for getting/setting value, size, and position. ```lua local menu = cheadle_api.ImGui.Menu("Example Menu", 0) menu:SetSize(400, 230) menu:SetPos(100, 100) local slider = cheadle_api.ImGui.Slider(menu, "sample slider", 0, 10) slider:SetPos(10, 35) slider:OnChangeFunction(function() cheadle_api.Log("Slider changed: " .. slider:GetValue()) end) ``` -------------------------------- ### Input Simulation Source: https://cheadleware.net/api/index Functions for simulating user input actions like button presses, mouse clicks, and key translations. ```APIDOC ## cheadle_api.Input.ButtonDown ### Description Simulates pressing down the specified button. ### Method POST ### Endpoint `/cheadle_api/Input/ButtonDown` ### Parameters #### Query Parameters None #### Request Body - **button_code** (number) - Required - The code of the button to press down. ### Request Example ```json { "button_code": 1 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Input.ButtonUp ### Description Simulates releasing the specified button. ### Method POST ### Endpoint `/cheadle_api/Input/ButtonUp` ### Parameters #### Query Parameters None #### Request Body - **button_code** (number) - Required - The code of the button to release. ### Request Example ```json { "button_code": 1 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Input.MouseClick ### Description Simulates a mouse click with the specified button. ### Method POST ### Endpoint `/cheadle_api/Input/MouseClick` ### Parameters #### Query Parameters None #### Request Body - **button** (number) - Required - The mouse button to click (e.g., `0` for left, `1` for right). ### Request Example ```json { "button": 0 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Input.ButtonClick ### Description Simulates a button click (press and release) of the specified button. ### Method POST ### Endpoint `/cheadle_api/Input/ButtonClick` ### Parameters #### Query Parameters None #### Request Body - **button_code** (number) - Required - The code of the button to click. ### Request Example ```json { "button_code": 1 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ## cheadle_api.Input.ButtonToVirtual ### Description Translates Source Engine button codes to Windows virtual key codes. ### Method GET ### Endpoint `/cheadle_api/Input/ButtonToVirtual` ### Parameters #### Query Parameters - **button_code** (number) - Required - Source Engine button code. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **virtual_key_code** (number) - The translated Windows virtual key code. #### Response Example ```json { "virtual_key_code": 72 } ``` ## cheadle_api.Input.VirtualToButton ### Description Translates Windows virtual key codes to Source Engine button codes. ### Method GET ### Endpoint `/cheadle_api/Input/VirtualToButton` ### Parameters #### Query Parameters - **virtual_key_code** (number) - Required - Windows virtual key code. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **button_code** (number) - The translated Source Engine button code. #### Response Example ```json { "button_code": 1 } ``` ``` -------------------------------- ### Log Source: https://cheadleware.net/api/index Logs messages to the console, with options for color and prefix. ```APIDOC ## Log ### Description Logs messages to the console, with options for color and prefix. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```lua -- Simple log cheadle_api.Log("This is a simple log message.") -- Log with color and prefix cheadle_api.Log({r=255, g=0, b=0}, "[INFO]", "This is an important message.") ``` ### Response #### Success Response (200) None #### Response Example None ### Parameters Details Overload 1: - **message** (string): The message to log. Overload 2: - **color** (table): A table with fields `r`, `g`, `b` representing the color. - **prefix** (string): A prefix for the log message. - **message** (string): The message to log. ``` -------------------------------- ### Font Management API Source: https://cheadleware.net/api/index APIs for creating and managing fonts. ```APIDOC ## BuildFont ### Description Creates a font from the specified font file and size, and assigns it the given title. ### Method N/A (Lua Function) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **title** (string) - Required - The name to assign to the font. * **path** (string) - Required - The path to the font file. * **size** (number) - Required - The size of the font. ### Request Example ```lua cheadle_api.BuildFont("myCustomFont", "path/to/font.ttf", 16) ``` ### Response #### Success Response (200) N/A (Lua Function, typically no direct return value for font creation) #### Response Example N/A ``` -------------------------------- ### Cheadle API Hooks Source: https://cheadleware.net/api/index Documentation for various hooks provided by the Cheadle API to listen to game events. ```APIDOC ## Hooks The `cheadle_api` provides a hook system that allows you to listen to Cheadle's events, as well as Garry's Mod hooks (excluding those called from Lua). ### Post_PreSend Hook #### Description Called immediately before sending movement packets to the server. Use this as a replacement for `CreateMove` to override actions performed by other modules. This hook is predicted if prediction is enabled. #### Parameters - `cmd` (CUserCmd) - The user command object. #### Example ```lua cheadle_api.CreateHook("Post_PreSend", "steamhappy", function(cmd) -- do magic end) ``` ### Pre_PreSend Hook #### Description Called immediately before sending movement packets to the server. Use this as a replacement for `CreateMove`. This hook is predicted if prediction is enabled. #### Parameters - `cmd` (CUserCmd) - The user command object. #### Example ```lua cheadle_api.CreateHook("Pre_PreSend", "steamhappy", function(cmd) -- do magic end) ``` ### Net_Receive Hook #### Description Called before `net.Incoming`, allowing for viewing net messages sent from the server before regular Lua processing. #### Parameters - `message_name` (string) - The name of the network message. #### Example ```lua cheadle_api.CreateHook("Net_Receive", "steamhappy", function(message_name) -- do magic end) ``` ### Net_ShouldSend Hook #### Description Called during `net.SendToServer`. If `false` is returned, the net message will be blocked from sending. #### Parameters - `message_name` (string) - The name of the network message. #### Example ```lua cheadle_api.CreateHook("Net_ShouldSend", "steamhappy", function(msg) if msg == "bad_ac_example" then return false end end) ``` ### SendNetMsg Hook #### Description Called when Source sends a network message. Return `true` to prevent this message from being sent. Applies to messages like `clc_Move`, `net_Tick`, `net_StringCmd`. #### Parameters - `name` (string) - The name of the network message. - `reliable` (boolean) - Whether the message is reliable. #### Example ```lua cheadle_api.CreateHook("SendNetMsg", "steamhappy", function(message_name, reliable) -- do magic end) ``` ### Aimbot_ShouldTarget Hook #### Description Allows overriding whether an entity should be targeted by the aimbot. Useful for ignoring entities for server-specific reasons. #### Parameters - `ent` (Entity) - The entity to check. #### Example ```lua cheadle_api.CreateHook("Aimbot_ShouldTarget", "steamhappy", function(ent) if cheadle_api.Config.GetFriendStatus(ent) then return false end -- ignore friends in aimbot end) ``` ### Aimbot_IgnoreObstacles Hook #### Description Allows adding entities to the aimbot trace filter list. #### Example ```lua cheadle_api.CreateHook("Aimbot_IgnoreObstacles", "steamhappy", function() local tr = LocalPlayer():GetEyeTrace() local ent = tr.Entity if(ent) then cheadle_api.BlockTraceEntity(ent) end -- ignore whatever entity you're staring at end) ``` ``` -------------------------------- ### Simulate Button Click (Cheadle Input API) Source: https://cheadleware.net/api/index Simulates a complete button click (press and release). It takes a numeric button code as input. This function is part of the `cheadle_api.Input` table. ```lua cheadle_api.Input.ButtonClick(button_code) ``` -------------------------------- ### ImGui Slider API Source: https://cheadleware.net/api/index API for creating and managing ImGui sliders. Allows setting the range, value, and defining callback functions for value changes. ```APIDOC ## ImGui Slider ### Description Creates an ImGui Slider. ### Syntax `cheadle_api.ImGui.Slider(parent, name, min, max)` ### Parameters #### Path Parameters * **parent** (ImGuiMenu) - Required - In which Menu this element should be parented to. * **name** (string) - Required - Name of this Slider. * **min** (number) - Required - Minimum value for this Slider. * **max** (number) - Required - Maximum value for this Slider. ### Request Example ```lua local menu = cheadle_api.ImGui.Menu("Example Menu", 0) menu:SetSize(400, 230) menu:SetPos(100, 100) local slider = cheadle_api.ImGui.Slider(menu, "sample slider", 0, 10) slider:SetPos(10, 35) slider:OnChangeFunction(function() cheadle_api.Log("Slider changed: " .. slider:GetValue()) end) ``` ### Methods * `Slider:GetValue(): number` * `Slider:SetValue(number value)` * `Slider:SetSize(number width, number height)` * `Slider:SetPos(number x, number y)` * `Slider:OnChangeFunction(function callback)` ``` -------------------------------- ### InviteFriend Source: https://cheadleware.net/api/index Sends a Steam invite to a friend. ```APIDOC ## InviteFriend ### Description Sends a Steam invite to a friend. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```lua cheadle_api.InviteFriend(steamid64) ``` ### Response #### Success Response (200) None #### Response Example None ### Parameters Details - **steamid64** (string): SteamID64 of the friend. ``` -------------------------------- ### Drawing API Source: https://cheadleware.net/api/index APIs for drawing various shapes and text on the screen. ```APIDOC ## DrawRect ### Description Draws a filled rectangle at the specified position with the given dimensions and color. ### Method N/A (Lua Function) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **x** (number) - Required - The X-coordinate of the rectangle’s position. * **y** (number) - Required - The Y-coordinate of the rectangle’s position. * **w** (number) - Required - The width of the rectangle. * **h** (number) - Required - The height of the rectangle. * **color** (table) - Required - A table representing the color with fields `r`, `g`, `b`, and optionally `a`. * **rounding** (number, optional) - The rounding radius for the rectangle’s corners (default `0`). ### Request Example ```lua cheadle_api.DrawRect(100, 100, 50, 50, {r=255, g=0, b=0, a=255}, 10) ``` ### Response #### Success Response (200) N/A (Lua Function, typically no direct return value for drawing) #### Response Example N/A ``` ```APIDOC ## DrawText ### Description Draws text at the specified position with the given color, alignment, and font. ### Method N/A (Lua Function) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **x** (number) - Required - The X-coordinate where the text will be drawn. * **y** (number) - Required - The Y-coordinate where the text will be drawn. * **text** (string) - Required - The text string to display. * **color** (table) - Required - A table representing the color with fields `r`, `g`, `b`, and optionally `a`. * **align** (number, optional) - Text alignment. Use `0` for left, `1` for center, `2` for right (default `0`). * **font** (string, optional) - The name of the font to use. ### Request Example ```lua cheadle_api.DrawText(100, 100, "Hello, Cheadle!", {r=0, g=255, b=0, a=255}, 1, "myFontName") ``` ### Response #### Success Response (200) N/A (Lua Function, typically no direct return value for drawing) #### Response Example N/A ``` ```APIDOC ## DrawCircle ### Description Draws a circle at the specified position with the given radius and color. ### Method N/A (Lua Function) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **x** (number) - Required - The X-coordinate of the circle’s center. * **y** (number) - Required - The Y-coordinate of the circle’s center. * **radius** (number) - Required - The radius of the circle. * **color** (table) - Required - A table representing the color with fields `r`, `g`, `b`, and optionally `a`. * **filled** (boolean, optional) - Whether the circle should be filled (default `false`). ### Request Example ```lua cheadle_api.DrawCircle(100, 100, 25, {r=0, g=0, b=255, a=255}, true) ``` ### Response #### Success Response (200) N/A (Lua Function, typically no direct return value for drawing) #### Response Example N/A ``` ```APIDOC ## DrawLine ### Description Draws a line between two points with the specified color. ### Method N/A (Lua Function) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **x1** (number) - Required - The X-coordinate of the line’s start point. * **y1** (number) - Required - The Y-coordinate of the line’s start point. * **x2** (number) - Required - The X-coordinate of the line’s end point. * **y2** (number) - Required - The Y-coordinate of the line’s end point. * **color** (table) - Required - A table representing the color with fields `r`, `g`, `b`, and optionally `a`. ### Request Example ```lua cheadle_api.DrawLine(10, 10, 50, 50, {r=255, g=255, b=0, a=255}) ``` ### Response #### Success Response (200) N/A (Lua Function, typically no direct return value for drawing) #### Response Example N/A ``` ```APIDOC ## DrawTexture ### Description Draws the specified texture at the given position and size. ### Method N/A (Lua Function) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **texture_name** (string) - Required - The name or path of the texture file. This is local to %appdata%/cheadleware-v2/data * **x** (number) - Required - The X-coordinate where the texture will be drawn. * **y** (number) - Required - The Y-coordinate where the texture will be drawn. * **w** (number) - Required - The width to draw the texture. * **h** (number) - Required - The height to draw the texture. ### Request Example ```lua cheadle_api.DrawTexture("myTexture.png", 100, 100, 64, 64) ``` ### Response #### Success Response (200) N/A (Lua Function, typically no direct return value for drawing) #### Response Example N/A ```