Kimberlite's Anime Expedition Macro
A configurable automation tool for the Roblox tower-defense game Anime Expedition. It drives the game window through a visual state machine that detects on-screen text with OCR, clicks buttons, moves the camera, places towers and loops rounds on its own. An optional remote access feature adds browser and phone monitoring plus a small set of safe remote controls — see Remote access.
Overview
The macro plays the game for you. You describe what the game looks like and what to do on each screen, and the tool repeats that loop automatically, round after round and map after map, until you stop it or it hits a limit you set.
Everything is driven by three ideas you configure through the GUI:
Positions
Points on screen the macro clicks: buttons, tower slots, menu options. Captured once, stored relative to the game window.
Detections
Regions the macro reads with OCR to know which screen it is on (in-game, round end, a specific map, a popup).
Flow
Screens and steps wired together so the macro reacts to what it sees and loops, or stops on a condition you set.
Installation & first launch
- Download the release EXE. Download
Kimberlites-Anime-Expedition-Macro.exe from the latest GitHub Release. AutoHotkey does not need to be installed.
- Run it once. Double-click the downloaded EXE. It installs the app for your Windows user, creates a Start Menu shortcut and opens the macro.
- Launch it later from Windows. Press the Windows key, type Kimberlite's Anime Expedition Macro and open the matching app.
- Updates happen before startup. Each launch checks GitHub for a newer release before the macro window opens. Verified updates replace the installed EXE without deleting your settings.
- Point it at the game. Open the General tab, section Game Window. Click Refresh, then pick the Roblox process from the Process list.
- Pin the game window. Press F7 (or the Placement Mode button). The tool moves the game window into a fixed rectangle (the opening) and locks it there, so every captured coordinate stays valid.
- Capture positions and regions. Use the Set Position and Select Region buttons to record the buttons and detection areas your preset needs (see Capturing positions).
- Choose and test a preset. On Preset Settings, select a preset and press Set as Active. Turn on Dry Run, press F10, and watch the log to verify the flow before letting it click for real.
Program files are installed under %LocalAppData%\Programs\Kimberlite's Anime Expedition Macro. Your configuration, backups and logs are stored separately under %LocalAppData%\Kimberlite's Anime Expedition Macro.
Quick start
Once everything is set up, a normal session is just three actions:
- Open the game and make sure it is in a normal window.
- Press F7 to pin the window (Placement Mode).
- Press F10 to start the active preset. Press Escape anytime for an emergency stop.
Keep the game window untouched while the macro runs. Moving, resizing or covering it, or clicking elsewhere, can throw off clicks and OCR. Use F9 to pause and Escape to stop.
Core concepts
Four terms show up throughout the app. Understanding them makes everything else easier.
Preset
A preset is one complete automation, for example "Challenges" or "Story Farming". It is a named collection of screens plus its own options and settings. You can have many presets and switch between them; only the one you mark Active runs when you press Start.
Screen
A screen is a named group of steps that represents one game state, such as "Menu", "Ingame" or "Round End". A preset is a list of screens. When a screen finishes without jumping elsewhere, execution falls through to the next screen in the list, wrapping back to the first after the last.
Step
A step is a single action or check inside a screen: click a button, place towers, wait, or run an OCR detection. Steps run top to bottom. See the full step type reference.
Cycle
A cycle is one full pass of the loop. It completes each time execution returns to the preset's start screen. The "Max cycles" setting and the "extra wait after each full cycle" both count cycles, and every cycle re-enables steps marked "Once per cycle".
Hotkeys
These work globally while the app is open.
| Key | Action | Notes |
| F7 | Placement Mode | Finds, positions and locks the game window into the opening. Do this before capturing positions or starting a run. |
| F8 | Capture position at cursor | While a Set Position capture is armed, records the current mouse point into the target field. |
| F9 | Pause / resume | Toggles the running macro without losing its place. |
| F10 | Start macro | Runs the active preset (the one shown in green on the "Runs on Start" line). |
| Esc | Emergency stop / cancel | Stops a running macro, cancels an armed capture, or closes the placement overlay. |
Preset Settings tab
This is the home tab: manage presets and see which one runs on Start.
Presets list & management
- Presets list: click one to view or edit it. Selecting a preset here does not change which one runs.
- New / Rename / Delete: manage the list.
- Edit: opens the full preset editor (screens, steps, options).
- Export / Import: save a preset (all its screens, steps, options and settings) to an
.ini file to back up or share, or load one back as a new preset. Coordinates are stored window-relative, so a shared preset works on a different screen too. Map profiles are not bundled, so set the Default Map after importing if the preset needs one.
- Set as Active: makes the selected preset the one that runs on F10 or Start. The active preset is shown in green on the "Runs on Start" line at the bottom of the window.
Selecting a preset is not the same as activating it. You can browse and tweak any preset without changing what actually runs. Only Set as Active changes the "Runs on Start" target.
Today's Challenge Usage
This box appears only for presets that use an Option Select step. It shows, per option, how many times it has already been played today against its daily limit (Used / Max). Both numbers are editable here, the count auto-increments as the macro plays an option, and it resets automatically on a new day. The limit stays in sync with the option's Max field in the editor.
Map Placement tab
Defines map profiles: per-map tower placement coordinates and camera setup. When a Place Towers step runs, it uses the profile of the map that was detected (or the preset's Default Map).
- Map Profile dropdown plus New / Rename / Delete: one profile per map you automate.
- Expected Map Text: the map name as it appears on the in-game banner. A Detect Map step reads the map-text region with OCR and matches it against this text to pick the profile.
- Use custom tower slots for this map: by default a map uses the shared default slots and placement count from the General tab. Check this to give the map its own slot sequence (each position uses tower slot 1 to 6) and its own number of placements.
- Coordinates for this map's tower placements: up to 10 positions, each with X, Y and a Set Position button. These are where towers get placed on this map.
- Advanced Settings: opens a per-map list of camera actions (Drag and Zoom Out) that run before towers are placed, so the camera is framed correctly on this map. There can be zero, one, or several.
General tab
Global timing, the shared tower loadout, the game-window setup, and disconnect handling.
Timing
| Setting | Meaning |
| Extra wait after each full cycle (sec) | Pause added once per completed cycle, on top of any per-step waits. |
| Click delay (ms) | Pause after each ordinary click. |
| Tower placement delay (ms) | Pause between the sub-actions of placing a tower (select slot, move, click) and between towers. |
| Max cycles (0 = unlimited) | Stops the macro automatically after this many cycles. 0 means run forever. |
| Position marker size (px) | Size of the on-screen crosshair used while capturing a position. |
Tower Loadout (default slots for all maps)
The fallback loadout used by any map that does not override it:
- Number of placements and Default slots (position 1 to 10): which tower slot (1 to 6) is used at each placement.
- Click after each tower placed: optional extra click at a fixed position after every tower, for example to dismiss a popup or confirm placement.
Game Window
- Process plus Refresh: pick the Roblox process the macro controls.
- Opening offset (x, y) and Opening size (w, h): the fixed rectangle (the opening) the game is pinned into, in absolute pixels. Every click and detection is stored as a percentage of this rectangle, so a preset keeps working if the opening later moves, changes monitor or changes resolution.
Disconnect Detection (Auto-Reconnect)
An optional safety net covered under Disconnect auto-reconnect.
Remote bridge
The "Enable remote bridge" checkbox in the bottom strip turns on the local file-based bridge that the optional remote access feature reads from. Off by default; the macro does no networking either way.
Bottom controls
| Control | What it does |
| Status line | The most recent log message or current action. |
| Runs on Start (green) | The active preset: what F10 or Start will run. |
| Dry Run | When checked, Start walks the preset and logs every action but performs no clicks, keys or drags. Every line is prefixed [DRY]. Always off at launch. |
| Save | Writes the current configuration to config.ini. |
| Placement Mode | Same as F7: pins the game window into the opening. |
| Start | Same as F10: runs the active preset. |
| Enable remote bridge | Turns on the local file bridge used by the optional remote access feature. Off by default; see Remote access. |
| Remote Agent Setup... | Opens the pairing window: set the agent executable path and server URL, pair with a one-time code, and start or stop the background agent. |
Capturing positions & regions
All click coordinates and OCR regions are captured visually, so you never type raw pixels. Each is stored as a percentage of the opening, which is why a preset survives the game window moving or changing resolution.
A single point: Set Position
- Pin the window first. Press F7 so the game sits in the opening.
- Click Set Position next to the field you want to fill. The app hides and a crosshair marker follows your mouse.
- Aim and press F8. Move the mouse over the exact target (a button, a tower slot) and press F8. Press Esc to cancel.
A rectangle: Select Region
For OCR detection areas, capture works like the Windows Snipping Tool: the app hides, the screen dims, and you click and drag a red rectangle over the text region. Release to set it; press Esc to cancel. Both opposite corners are written into the region fields at once.
Frame OCR regions tightly around the text you care about, with a little margin. Too much surrounding UI makes matches less reliable. Use Show Region to preview exactly what a region covers.
The preset editor
Opened with the Edit button on the Preset Settings tab. This is where you build a preset's screens and steps.
Screens
Use the Screen dropdown to switch screens, and New Screen, Rename, Delete, Move Up and Move Down to manage them. Screen order matters: a screen that finishes without jumping falls through to the next one in the list.
The step list
The table shows every step on the current screen with its key fields (type, name, coordinates, jumps, waits, fallbacks). Click a row to load it into the Step Editor below. You can drag a row to reorder it.
Step Editor
Add or change one step at a time:
- Type: what the step does (see the reference table). The other fields relabel themselves to fit the type.
- Name: a label. For detection steps the Name also doubles as the expected OCR text to match.
- X, Y plus Set Position, and (for Drag or logic regions) End X, End Y plus Drag (ms).
- Wait After (s): pause after this step (accepts decimals like
0.5).
- On True, On False: where to go when the step finishes (see Screens & flow).
- Once per cycle: run this step only once, then skip it until a new round begins.
- Fallback after N attempts: a safety net for detection steps that retry (see below).
- Test OCR, Show Region: for detection steps, verify what the region reads right now.
Buttons: Add Step, Update Selected, Remove Selected, Move Up, Move Down, and Start Macro From This Step (runs the preset you are editing beginning at the selected step, handy for testing one screen).
Import From Preset
Reuse work across presets: pick another preset (or the current one) and either Import Screen (its whole step list) or Import Step (a single component with all its settings) into the screen you are editing. Any jumps that point to screen names not present here simply fall through with a warning at runtime, so rename them afterward if needed.
Step type reference
There are two families of steps. Mechanic steps do something and then jump unconditionally (via On True). Logic steps read the screen with OCR and branch differently on On True versus On False.
| Step | Family | What it does |
| Start | Marker | No action. Marks which screen a cycle begins on (and where cycle-complete bookkeeping fires). If no Start exists, the first screen in the list is used. |
| Option Select | Mechanic | Tries challenge options by priority: clicks one, optionally verifies it is playable via OCR, and moves on if not. Respects each option's daily limit; jumps to a fallback screen (or stops) if none are available. See Challenge options. |
| Button Click | Mechanic | Clicks the position at X, Y. |
| Press Start Button | Mechanic | Same as a click. A separate name so the "start the round" button reads clearly in your step list. |
| Restart Stage Button | Mechanic | Same as a click. A distinct name for the "restart or retry stage" button. |
| Camera Setup | Mechanic | Explicitly runs the current map's Drag and Zoom Out advanced actions. Put it first on a screen when the camera must be framed before anything else. |
| Place Towers | Mechanic | Places towers for the resolved map: frames the camera (once per cycle), then for each placement selects the tower slot and clicks its position; optional extra click after each. |
| Drag | Mechanic | Right-click-drags the camera from X, Y to End X, End Y over the given duration. |
| Zoom Out | Mechanic | Scrolls the mouse wheel down N ticks (the tick count is stored in the X field). |
| Wait | Mechanic | Does nothing but apply its Wait After (s): a plain delay. |
| Detect Map | Logic | Reads the map-text region with OCR and matches it against your map profiles' Expected Map Text. Marks the start of a new round (re-enables "Once per cycle" steps). Branches on whether a map matched. |
| Round End Detection | Logic | Reads its region for the expected text (the step's Name) to detect the end-of-round screen, then branches. |
| Ingame Detection | Logic | Same mechanism, tuned for confirming you are in the round. |
| Custom Detection | Logic | A general OCR check for any text. With Advanced Detection on, it replaces the single True/False branch with any number of named outcomes; each outcome's name is matched against the region and jumps to its own screen. First match wins. |
The four logic steps (Detect Map, Round End Detection, Ingame Detection, Custom Detection) are the ones that can branch on what OCR sees. Everything else jumps unconditionally.
Screens & flow
The macro walks screens in list order. Detection steps steer the flow with two dropdowns, On True and On False, while mechanic steps use just On True as a single unconditional jump. Each dropdown offers:
| Choice | Effect |
(continue) | Keep running the rest of this screen normally. |
| A screen name | Jump to that screen and start it from the top. |
(Repeat) | Re-run this exact step again, waiting this step's Wait After between attempts. Great for a detection that should keep checking until it matches. |
(Stop Macro) | End the run cleanly. |
Fall-through & wrapping
When a screen finishes without any jump firing, execution falls through to the next screen in the list, wrapping back to the first after the last. This is why screen order matters and why a linear flow often needs no explicit jumps at all.
Fallback after N attempts
A detection step whose branch is set to (Repeat) could loop forever if the expected text never appears. Enable Fallback after N attempts on that step to give up after N unsuccessful repeats and jump to a chosen screen (or stop the macro) instead. The counter resets as soon as the step succeeds, and whenever a new round starts (a Detect Map step runs).
A typical loop: a Menu screen selects a mode, a Detect Map step picks the profile, an Ingame screen places towers and waits, and a Round End Detection loops back to Menu on victory or defeat. Add a Start component to whichever screen should be the true beginning of each cycle.
Challenge options
An Option Select step chooses between up to three options (for example three daily challenges) each cycle. Options are configured in the editor, in the section that appears while editing an Option Select step. Each option has:
- Name: label (and shown in the "Today's Challenge Usage" box).
- X, Y: where to click to select this option.
- Available at start: uncheck to skip an option entirely.
- Priority (1 to 3): options are tried lowest-number first.
- Max: daily play limit (
0 = unlimited). Resets each day; the count is shown and edited on the Preset Settings tab.
- Availability Check: an optional OCR region plus expected text that confirms the option is actually playable before committing. If the check fails, the macro clicks Back and tries the next priority.
When nothing is available
Two shared controls handle the "no option available" case:
- Back Button: clicked to return from an option's detail screen after its availability check fails, so the next priority can be tried.
- Fallback Screen: jumped to if every option is unavailable (including all daily limits reached). Set it to
(Stop Macro) to end cleanly, or leave it on (none) to fall back to waiting 5 seconds and re-checking.
A Default Map can also be set per preset, used by Place Towers if no Detect Map ran or nothing matched.
Map profiles & loadout
Tower placement is data-driven so one preset can play many maps correctly.
- A Detect Map step reads the map banner and matches it to a profile's Expected Map Text (or the preset's Default Map is used).
- A Place Towers step then runs that map's camera actions (Drag and Zoom Out from Advanced Settings) once, and places each tower: select the slot, click the recorded position, repeat.
Slots and placement count come from the shared Tower Loadout unless the map has "Use custom tower slots" checked, in which case it uses its own slots and count. Tower slots are numbered 1 to 6, matching the game's hotbar.
Map profiles are not included when you export a preset. After importing a shared preset, recreate the needed map profiles (or set a Default Map) so Place Towers has coordinates to use.
OCR detection & testing
Detection uses the built-in Windows OCR engine. A small helper process (ocr_server.ps1) loads the engine once and answers scan requests quickly for the whole session; a one-shot helper (ocr_region.ps1) is the fallback. You do not manage these; they start and stop with the macro.
To recognize small game text reliably, the tool automatically enlarges smaller regions before reading them, so tightly-framed button and banner text still scans well.
Testing a region
Every detection field pairs with two buttons:
- Show Region: briefly outlines exactly what area the region covers, so you can confirm it frames the right text.
- Test OCR: scans the region right now and prints what it read. Use it while the relevant screen is visible in-game.
Matching is forgiving: the expected text is matched within the recognized text (with a fuzzy fallback), so you do not need a perfect character-for-character read. Keep expected text short and distinctive, such as Victory or Reconnect.
Disconnect auto-reconnect
On the General tab, Disconnect Detection keeps long unattended runs alive. When enabled, it periodically reads a region with OCR looking for a phrase (for example a Reconnect popup); on a match it clicks your Reconnect button position and restarts the active preset from the beginning, as if you had pressed F10 again.
- Enable: turn the whole feature on.
- Region 1, Region 2: the two corners of the area to watch (set via Select Region).
- Expected Text: the phrase that signals a disconnect.
- Reconnect X, Y: where to click to reconnect.
- Check every (sec): how often to scan.
- Test OCR, Show Region: verify the watch area as usual.
Dry run & testing
Before letting a new or changed preset click for real, verify it safely:
- Dry Run: check the box, then Start. The macro walks the whole preset and logs every action it would take (prefixed
[DRY]) without performing any click, key or drag. Watch the log to confirm the flow, jumps and detections make sense.
- Start Macro From This Step: in the editor, run the preset you are editing starting at a selected step, to exercise one screen without going through the whole loop.
- Test OCR, Show Region: confirm each detection reads correctly on the live screen.
Dry Run is always off when the app launches, and toggling it mid-run has no effect. The value is locked in when you press Start.
Running the macro
- Open the game. Have Anime Expedition running in a normal window on the screen you will use.
- Pin the window. Press F7 so the game sits in the opening and is locked in place.
- Confirm the active preset. Check the green "Runs on Start" line. Change it with Set as Active if needed.
- Start. Press F10 (or Start). The log and status line show live progress; the editor follows along, highlighting the current screen and step.
- Pause or stop. F9 pauses and resumes; Escape is an immediate emergency stop. The macro also stops on its own when it hits Max cycles or a
(Stop Macro) outcome.
The macro moves the real mouse and keyboard. Keep your hands off the mouse while it runs, and do not let other windows steal focus from the game.
Remote access
An optional feature that lets you watch and steer the macro from a browser or phone, from anywhere, once it is set up. It is off by default and adds no networking to the macro itself — you are using it right now, on the same site as this guide.
Macro
Still does no networking. It only writes a status file and log, and reads a small whitelisted command file, exactly like the OCR helper.
Agent
A small background program (a single .exe) that reads those local files and talks to the backend over an outbound-only connection. No inbound ports, no firewall changes.
This site
Sign in on the Dashboard tab, pair a device, and get live status, logs and a small set of safe remote controls.
The chain is: macro (local files only) → agent (phones home, outbound only) → this backend and dashboard (accounts, live status, the whitelisted controls).
Setting up remote access
- Enable the bridge in the macro. On the General tab, check "Enable remote bridge" (bottom strip). The macro starts writing its status file and watching for commands; nothing leaves your PC yet.
- Create an account and add a device. On the Dashboard tab of this site, sign in (or create an account), then click Add device to get a one-time pairing code (valid about 10 minutes, single use).
- Pair the agent from the macro's GUI. Click "Remote Agent Setup..." next to the bridge checkbox. Point Agent executable at the downloaded
animeexpedition-agent.exe, set the Server URL, paste the pairing code, and click Pair. The macro itself still does no networking here — it launches the same agent .exe you could run by hand and reads back the result.
- Start the agent. Click "Start Agent" in the same window (it also auto-starts right after a successful pairing). "Stop Agent" is next to it, and both reflect whether the agent process is actually running, even after the macro restarts.
- Confirm it is online. Back on the Dashboard tab, the device row shows Agent online and Macro online once both are up and reporting.
Pairing can also be done from a terminal instead of the macro's GUI: animeexpedition-agent.exe --server <url> --pair <code>. Either way the device token is stored locally on that PC (never shown again after pairing) and can be revoked at any time from the dashboard.
Using the dashboard
Once a device is paired, select it in the device list to see:
| Panel | Shows |
| Run state | Online/offline, running/paused/stopped, active/running/queued preset, current map/screen/step, cycle count, victories and defeats, and whether Dry Run is on. |
| Controls | Pause, Resume, Stop, set the active preset, or queue a different preset for the next cycle boundary. Disabled while the macro is offline. Each one does exactly what the matching hotkey or button would do locally — nothing more. |
| Logs | The latest lines from macro_log.txt, streamed live. |
Account security
The Security card lets you turn on two-factor authentication (an authenticator app, plus one-time backup codes) for your account. The Recent activity card is an audit log of sign-ins, pairing, revocations and remote commands issued from this account.
Security & limits
- Fixed command whitelist. A remote command can only be Pause, Resume, Stop, Set active preset, or Queue preset — never raw coordinates, keystrokes or arbitrary presets.
- No remote Start (yet). Starting the macro can raise a local confirmation dialog, so it stays a local-only action for now.
- Outbound-only, revocable. The agent only ever calls out to the backend; device tokens are separate from your account password and can be revoked instantly from the dashboard.
- Known risk. Automating a Roblox game, remotely or not, can put your Roblox account at risk under its Terms of Service. Remote access does not change that risk — it only changes where you are sitting when you use the macro.
Config & backups
config.ini: holds every setting, preset, screen and step. The installed app keeps it in %LocalAppData%\Kimberlite's Anime Expedition Macro; it is created automatically. Press Save to write it (the app also saves at key moments).
config_backups/: timestamped automatic backups of config.ini, so you can roll back if an edit goes wrong. Just copy a backup over config.ini to restore.
macro_log.txt: a full running history of log messages across sessions.
To move your whole setup to another PC, copy config.ini and config_backups/ from %LocalAppData%\Kimberlite's Anime Expedition Macro. To share just one automation, use Export instead.
Troubleshooting & FAQ
The macro cannot find the game window
Open General, section Game Window, click Refresh, and re-select the Roblox process. Make sure the game is running and the window is not minimized.
Clicks do not register in the game
Make sure the game window is the one pinned by F7 and that it has focus (nothing covering it). Coordinates are relative to the opening, so if you resized the game, re-pin with F7 and confirm the opening size roughly matches the window.
OCR returns nothing or matches the wrong screen
Use Show Region to confirm the region frames the text, and Test OCR while that screen is visible. Tighten the region around the text, keep the expected text short and distinctive, and make sure an English OCR language pack is installed.
Towers are placed in the wrong spots
Re-capture the placement positions for that map (Map Placement tab) after re-pinning the window. Verify the correct map profile is detected (check the log after a Detect Map step) or set a Default Map.
A detection loops forever
If a step's branch is (Repeat), enable Fallback after N attempts on it so it gives up and moves on instead of retrying indefinitely.
It stopped by itself
Check the log. Common reasons are reaching Max cycles, a (Stop Macro) outcome, all challenge options hitting their daily limit, or Escape being pressed.
The dashboard shows the macro or agent as offline
Confirm "Enable remote bridge" is checked in the macro (General tab) and that the agent is running ("Start Agent" in the Remote Agent Setup window, or the agent process from a terminal). Both the macro and the agent need to be running on the same PC for a device to show online.