# Aimsense CS:GO Lua API Reference for AI Agents # Format: Plain text specification for autonomous coding agents & LLMs > Runtime: LuaJIT 2.1 (Lua 5.1 syntax). > Execution Model: In-process on game thread inside CS:GO frame loop. ## CRITICAL AGENT RULES & CONSTRAINTS 1. NEVER execute blocking operations (e.g. synchronous network calls, file extractions) inside `render` or `createmove` callbacks. 2. ALL entity reads can be nil. ALWAYS check existence and life state: ```lua local me = entity.get_local_player() if not me or not me:is_alive() then return end ``` 3. `render.*` functions are STRICTLY VALID ONLY inside the `render` callback. 4. Netprop arrays are 0-BASED and have NO BOUNDS CHECKING. Never use `#` for length. Always index `0 .. size - 1`. 5. `draw_chams` MUST return an explicit integer: - Return `0`: Script takes over rendering (requires `materials.draw_chams(mat)`). - Return `1`: Default rendering proceeds. - Falling off end without return defaults to `0` (hides model). 6. `json.stringify` cannot serialize userdata (`vector`, `qangle`, `color`). Extract numbers into a plain table first: `{ x = v.x, y = v.y, z = v.z }`. 7. Lua standard `io` library is DISABLED. Use `files` and `database` tables instead. 8. Widget values persist automatically to `aimsense/scripts/data/