> For the complete documentation index, see [llms.txt](https://scripter-sm.gitbook.io/elite-zone/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scripter-sm.gitbook.io/elite-zone/ragebot-planner-luas.md).

# Ragebot planner Luas

Write the brain of the ragebot. Detect what enemies run, switch presets, and add your own strafes, shooting methods and algorithms.

{% hint style="warning" %}
**Read** **Config makers** **first.** It explains what every ragebot option does, and a planner is mostly about choosing between them at the right time.
{% endhint %}

The ragebot gives you lots of strafes and shooting methods, but it doesn't decide **which one to use against whom**. That's the planner's job. A planner can also improve the ragebot itself: add new strafes, new shooting methods and whole new algorithms.

## An algorithm, in plain words

* If you detect a **UE user with a gun or knife**, use **UE Killer**.
* If you detect a **UE user with melee**, switch to **OOB Baiting**.

That's a basic example. You can go much further: track how each enemy moves, count your misses, time their cooldowns, add brand new methods.

```lua
local lua = api.register("UE Counter", "ragebot planner")

local current
local function use(preset)
    if current ~= preset then
        current = preset
        api.ragebot.apply_preset(preset)
    end
end

lua.step = function(dt, duel, status)
    local target = api.ragebot.target()
    if not target then
        return
    end
    local weapon = api.game.weapon(target.player)
    if weapon == "Fists" or weapon == "Katana" then
        use("OOB Baiting")
    else
        use("UE Killer")
    end
end

lua:override()
```

{% hint style="info" %}
How you **detect** a UE user is up to you. The example only looks at the weapon name.
{% endhint %}

## What a planner can do

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Every-frame hooks</strong></td><td><code>step</code>, <code>target</code>, <code>can_shoot</code>, <code>anti_aim</code>: decide, pick, veto and rotate every frame.</td><td></td></tr><tr><td><strong>Presets</strong></td><td>Apply, capture and save presets, including the ones in the user's config.</td><td></td></tr><tr><td><strong>Custom methods</strong></td><td>Add strafes and shooting methods to the dropdowns, with their own settings that only show when selected.</td><td></td></tr><tr><td><strong>Desync</strong></td><td>Put yourself anywhere for the server, every frame.</td><td></td></tr><tr><td><strong>Healing</strong></td><td>Heal with the medkit in the void whenever your planner decides to.</td><td></td></tr></tbody></table>

## The hooks at a glance

| Hook            | Called                                 | Return                         |
| --------------- | -------------------------------------- | ------------------------------ |
| `lua.step`      | every ragebot frame, every round state | `"stop"`, `"evade"` or nothing |
| `lua.target`    | when the ragebot picks a target        | a target, or `nil` for none    |
| `lua.can_shoot` | before each shot                       | `false` to hold fire           |
| `lua.anti_aim`  | every frame once the round started     | a `CFrame` to use, or `nil`    |

## Taking over vs. helping out

While a planner is loaded, the ragebot box hides every setting except **enabled**, and shows **ragebot is controlled by ragebot planner**.

* If your planner **drives** the ragebot, keep it that way so the user can't fight it.
* If it only **adds** presets or methods and lets the user choose, call `lua:allow_manual(true)` so the settings stay visible. Your method settings boxes live in the ragebot box too, so they need this.

## Read next

* Lua basics: register, load, clean up.
* api.ragebot: every hook and function in detail.
* Settings reference: internal names for every setting you'll change.
* api.ui: add settings, tabs and dependencies for your planner.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://scripter-sm.gitbook.io/elite-zone/ragebot-planner-luas.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
