> For the complete documentation index, see [llms.txt](https://docs.autowall.fun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autowall.fun/documentation/introduction.md).

# Introduction

## Introduction

This documents the **actual, implemented** Lua scripting API in this project (`antisocial/src/cheat/lua/lua_manager.cpp`), as opposed to the aspirational spec in `lua/*.md`. Anything not yet implemented is listed in [Roadmap](/documentation/roadmap-not-implemented-yet.md) instead of documented as if it worked.

{% hint style="info" %}
Looking for function signatures? Jump straight to Vars.
{% endhint %}

### Runtime

* **Lua 5.4** (vendored from lua.org, `antisocial/thirdparty/lua/`) — not LuaJIT. No `ffi`, no `bit32`/`jit` libraries. Standard Lua 5.4 bitwise operators (`&`, `|`, `<<`, `>>`) are available directly.
* Every script gets its **own `lua_State`** (`c_lua_manager::start`) — fully isolated globals, no sharing between scripts.
* Scripts live in `Documents/lua/<name>.lua`, managed from the in-app **Lua** tab (sidebar: *Create LUA* / *List LUA's*).
* A script is **running** (its `events.update`/`events.render` fire every frame) from the moment you press **Start** until **Stop** — it is not re-run from disk automatically.

### Where things run

* `events.update:set(fn)` — called once per frame, before render.
* `events.render:set(fn)` — called once per frame, inside a full-screen, input-transparent ImGui overlay window (`##lua_overlay`) drawn on top of the game — this is why `render.*` works like "part of the menu" rather than a raw draw-list layer.
* Both are dispatched through a protected `lua_pcall`, so an error in one script cannot crash the app or break other scripts — it just gets recorded (see [Events](/documentation/vars/events.md#error-handling)).

### Diagnostics

The Lua tab's editor view shows, live, for the open script:

```
RUNNING            (or STOPPED)
upd:123 rnd:456 err:0
```

`upd`/`rnd` are how many times `events.update`/`events.render` have actually fired since Start; `err` is how many of those calls raised a Lua error.

{% hint style="warning" %}
If `rnd` stays at `0` while running, `events.render:set(...)` was never reached (syntax error, or the script just doesn't call it). If `rnd` grows but nothing appears on screen, the bug is in what you're drawing, not in the event pipeline.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.autowall.fun/documentation/introduction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
