AoE2Control: Lua Scripting Engine for Age of Empires II: Definitive Edition

AoE2Control (CONTROL) runs Lua modules inside Age of Empires II: Definitive Edition. A module reads game state and gives commands from inside the game process. It does not scan pixels or simulate mouse and keyboard input. Use it for bots, overlays, automation and external AI agents.
(extraction password: control)
What Is AoE2Control?
A CONTROL module can:
- Read game state: units, buildings, resources, players and map tiles. By default a module sees only what its player sees; the Modules See Everything setting removes the fog of war.
- Command its player: train units, move armies, research technologies.
- Draw overlays: text, shapes and markers on the screen, in the game world and on the minimap.
- Add settings to the CONTROL menu, which the user changes while the game runs.
Key Features for AoE2 Lua Scripting
| Feature | Description |
|---|---|
| Launcher | Starts CONTROL in the running game. |
| Game API | Over 100 functions for commands, game facts and drawing, plus strategic components. |
| Per-player modules | Each of the 8 player slots can run its own module in the same match. |
| Drawing | Shapes and text in screen, world or minimap coordinates. |
| Module settings | Checkboxes, sliders, dropdowns, keybinds and color pickers in the CONTROL menu. |
| Multi-file modules | require() loads Lua files from the module's folder. See Module System. |
| IPC | Named pipes with JSON messages connect a module to an external program. See IPC API. |
| Packaged modules | A .module file holds a module as encrypted, compiled Lua. |
| VS Code extension | aoe2-control-lua on the Marketplace: autocompletion, snippets and API definitions. |
| AI reference | The whole Lua API on one page, ready to paste into a coding agent's prompt. |
Who This Documentation Is For
- Lua scripters building bots, overlays or automation.
- AI and ML developers connecting external agents through IPC.
- AoE2 modders making in-game tools.
Prerequisites
- Age of Empires II: Definitive Edition.
- Windows, 64-bit.
- Some Lua helps but is not required.
Quick Links
- Download Latest Release: the launcher.
(extraction password:control) - Getting Started: install CONTROL and run a first module.
- Quick Example: a small module that uses settings, commands and drawing.
- Headless Mode: start the launcher from a script.
- Game API: commands and facts.
- Automation & Session Control: start matches, load saves and change the game setup.
- Render API: drawing overlays.
- AoE2RMSIDE: the random map editor with live preview, map tests and live testing through CONTROL.