# misc

Responsible for miscellaneous API features that don't require their own table.


# Functions

# misc.get_username(): string

misc.get_username(): string
  • Retrieves the current username in the cheat.
local username = secret.misc.get_username()
print("Current username:", username) 

# misc.in_screenshot(): boolean

misc.in_screenshot(): boolean
  • Returns true if a screenshot is being captured, otherwise false.
if secret.misc.in_screenshot() then
    print("Warning: Screen capture detected!")
else
    print("No screen capture detected.")
end

# misc.get_freecam_pos(): table

misc.get_freecam_pos(): table
  • Retrieves the current position of the freecam in the world.
local freecam_pos = secret.misc.get_freecam_pos()

if freecam_pos then
    print("Freecam Position:")
    print("X:", freecam_pos.x)
    print("Y:", freecam_pos.y)
    print("Z:", freecam_pos.z)
else
    print("Freecam is not enabled.")
end

# misc.get_freecam_angles(): table

misc.get_freecam_angles(): table
  • Retrieves the current angles of the freecam.

# misc.mouse_event(dwFlags: number, dx: number, dy: number, dwData: number)

misc.sendmouse(action: string, x?: number, y?: number)
  • Sends a mouse action directly to the engine.
  • action can be:
  • "left" – left mouse button down/up (boolean second parameter).
  • "right" – right mouse button down/up.
  • "move" – move the mouse by x, y (delta coordinates).
  • "wheel" – scroll the mouse wheel (second parameter = amount).
-- press left button
secret.misc.sendmouse("left", true)
secret.misc.sendmouse("left", false)

-- move mouse to (100, 200) inside the game
secret.misc.sendmouse("move", 100, 200)

-- scroll wheel up
secret.misc.sendmouse("wheel", 120)

# misc.sendkey(vk: number, press: boolean)

misc.sendkey(vk: number, press: boolean)
  • Sends a key press or release to the engine.
  • vk – virtual key code (e.g., 0x44 for D).
-- press and release D key
secret.misc.sendkey(0x44, true)
secret.misc.sendkey(0x44, false)

-- press and release Space
secret.misc.sendkey(0x20, true)
secret.misc.sendkey(0x20, false)

# misc.add_to_player_esp(index: number, text: string, color: table, position: number)

misc.add_to_player_esp(index: number, text: string, color: table, position: number)
  • Adds an ESP element for a specific player in the game. It allows you to display additional information about the player such as armor, etc.
local DRAW_TOP = 0
local DRAW_BOTTOM = 1
local DRAW_RIGHT = 2
local DRAW_LEFT = 3

secret.listener.add("view_render_post", "Api Example", function()
  for k, v in pairs(player.GetAll()) do
    local index = v:EntIndex()
    secret.misc.add_to_player_esp(index, "Skibidi toilet!", { 255, 255, 255, 255 }, DRAW_TOP)
  end
end)

# misc.add_to_ent_esp(index: number, text: string, color: table, position: number)

misc.add_to_ent_esp(index: number, text: string, color: table, position: number)
  • Adds an ESP element for a specific entity in the game. It allows you to display additional information about the entity.

# misc.get_aimbot_target(): number

misc.get_aimbot_target(): number
  • Returns the current aimbot target index, if the target is not valid, it will return nil.

# misc.setcvar(cvar: string, value: string)

misc.setcvar(cvar: string, value: string)
  • Allows you to set a variable (cvar) to a specified value.

# misc.get_address(): string | false

misc.get_address(): string | false
  • Gets the current address of the server you are connected to.

# misc.is_connected(): boolean

misc.is_connected(): boolean
  • Checks if you are connnected to a server.

# misc.command(cmd: string)

misc.command(cmd: string)
  • Runs a console command in regular string format.

# misc.add_to_entity_list(entity_name: string, action: boolean)

misc.add_to_entity_list(entity_name: string, action: boolean)
  • Adds or removes an entity from the entity list.
  • Note that the entity must already be present in the entity list, which only includes scripted entities.
secret.misc.add_to_entity_list("gmod_hands", true) -- add the entity to ents esp
secret.misc.add_to_entity_list("gmod_hands", false) -- remove the entity from the ents esp

# misc.get_entity_list(): table

misc.get_entity_list(): table
  • Returns a table of all known scripted entities.
  • The keys are entity class names (e.g., "prop_physics"), and the values are booleans indicating whether each entity is currently selected.
local entities = secret.misc.get_entity_list()

for name, selected in pairs(entities) do
    print(string.format("entity: %s | selected: %s", name, tostring(selected)))
end

# misc.desync_time(): number

misc.desync_time(): number
  • Returns the desynced time when using the desynculator.

# misc.get_random_source(): string

misc.get_random_source(): string
  • Returns a random loaded Lua source file name or path on the client.
  • "static source" in the lua tab will affect this function.

# misc.current_charge(): number

misc.current_charge(): number
  • Returns the current charged ticks when using tickbase shift.