HOOZiDocs
Skip to content

Globals + Overview

Quick reference: module structure overview, style conventions, global variables. Each module's detailed fields and signatures are in the corresponding sidebar page.


Module Structure Overview

══ Globals ═════════════════════════════════════════════════════════════
_SCRIPT_PATH        Current script path (read-only)
print               Redirected to log.info
Delay(sec, fn)      Run fn after sec seconds (auto-cancelled on unload)
shared              Cross-script shared Lua table

══ Primary domain 9 ═══════════════════════════════════════════════════

event                                   Subscribe
├─ on(name, fn) → handle
└─ off(handle)

gui                                     Menu UI + config write (the only write path)
├─ tab / sub_tab / window
├─ find / get / set / children       children(path) returns a container's direct child controls
├─ show / hide / set_enabled / set_visible
├─ is_visible / get_main_window      Menu state + geometry
├─ list_hotkeys                       Every hotkey-bound control (Checkbox + KeybindControl)
├─ get_selected_weapon               Currently selected weapon ID in the weapon library
├─ Container methods: group/checkbox/slider/slider_float/dropdown/
│             combobox/slider_range/color_edit/input_text/multi_dropdown/
│             keybind_control/tips/live_table/button/settings
│             settings(id,label,icon?) gear-collapsed container
├─ custom(id, proto, height?)        Lua-driven custom control (LuaControlProto-style)
└─ Window only: bind_visible

esp                                     ESP elements
├─ add / find / remove
├─ elements / scenario
└─ INV / VIS / DWN / ALLY

game                                    Live data (read-only, writes raise an error)
├─ localplayer
├─ entities.{players,loots,projectiles}
├─ aimbot                               trigger / solve / register_algorithm / set_predictor
└─ world.{ring,map_name}

net
├─ http: get / post / request             Async only (callback dispatched on menu thread)
├─ ws:   connect / send / close / is_open Client, all async with 4 callbacks
└─ ws_server: listen → :send / :broadcast / :disconnect / :close

draw                                    Screen drawing
├─ line / rect / rect_gradient
├─ triangle_multicolor / circle_multicolor
├─ circle / triangle / quad / polyline
├─ shadow_line / shadow_rect / glow_circle  Shadow + outer glow
├─ text / image / image_rotated
├─ push_clip / pop_clip                 Rectangular clip stack
├─ measure / screen / fonts / font
└─ rgba / u8 / hex / color_mod_a / color_lerp
   color_darken / color_lighten / color_hsv

math                                    Extends Lua stdlib
├─ Vec2 / Vec3
├─ Lerp / Clamp / Smoothstep
├─ RemapVal / RemapValClamped
├─ AngleNormalize / CalcAngle
├─ WorldToScreen / WorldToMapPixel / WorldRadiusToMapPixel
└─ ease_in / ease_out / ease_in_out / ease_in_cubic
   ease_out_cubic / ease_bounce

file                                    Files + resources
├─ read / write / exists / remove / rename
├─ list / scan(glob)
└─ image: load / svg / create / get / has / list / remove
   load_gif / animated multi-frame

input                                   Input + keybind formatter + clipboard
├─ is_active / format / unformat
└─ clipboard_get / clipboard_set

══ Misc 8 ══════════════════════════════════════════════════════════════

log         info / success / warn / error
notify      info / success / warn / error
script      load / unload
time        now / delta / curtime / game / frame_count
config      save / save_as / switch / list / current
json        encode / decode
utils       base64_encode / base64_decode / array_to_string / string_to_array
            murmur2 / fnv1a / unix_time / get_date
            db_save / db_load  (script-scoped KV persistence)
            (clipboard moved → input.clipboard_get / clipboard_set)
mem         get_module_base / get_module_size / is_valid / find_pattern
            read_* / scatter / write_* / write_scatter  (DMA read+write; writes are dangerous, see the mem page)
offsets     named offset table offsets[section][sub][key] / offsets.find  (dumper-synced, pairs with .base for self-service)

Style Conventions

FormPurpose
obj:method(args)Stateful object methods (gui.find, network, file resources, esp element)
obj.fieldRead-only data fields (game.* / event parameters / entity attributes)
module.sub.field or module.sub:methodNested namespace (net.http / game.entities / file.image)
module.func(args)Module shortcut function

Naming: modules are all-lowercase single words / functions and fields are snake_case / constants are SCREAMING_CASE / usertypes are CamelCase / event names are snake_case strings.

Owner-scoped auto cleanup: When a script is unloaded, the following resources are released automatically; you don't need to hand-write a script_unloaded listener.

  • event.on subscriptions (including custom event handlers)
  • Delay() pending entries (un-fired entries are cancelled)
  • esp.add elements
  • Containers and controls created via gui.*
  • input.format keybind formatters
  • net.http callbacks (alive flag — queued callbacks are dropped silently)
  • net.ws:connect connections + net.ws_server:listen listeners (including all clients)
  • file.image:load/svg/create/load_gif textures

Global Variables

_SCRIPT_PATH : string (read-only)

The path of the currently executing script (relative to scripts/). Injected by the runtime before the script is loaded.

print(...)

Redirected to log.info.

Delay(sec : number, fn : function)

Calls fn once after sec seconds. Fires on the render thread, in sync with event.on("frame_update", ...). Pending entries are auto-cancelled when the script is unloaded — no manual cleanup needed.

lua
Delay(0.5, function() print("printed after 0.5s") end)

-- Pair with Delay for polling / retries
local function retry(n)
    if n <= 0 then return end
    net.http:get("https://api/heartbeat", function(resp)
        if not resp.ok then Delay(1, function() retry(n - 1) end) end
    end)
end
retry(3)

shared : table

A plain Lua table shared across scripts. Any script can read or write it; its lifetime matches the Lua state. Writes are visible to other scripts immediately — no snapshot, no lock.

Reload does not clear it: script reload only unloads the GUI / event / esp resources registered by that script. shared itself is created once when the Lua state is built and is never wiped. A script that wants its own namespace reset on reload must do shared.my_ns = {} itself at the top.

See Getting Started for usage patterns.