How Codex plays Factorio: headless Lua state reading plus xdotool GUI control
john_lam · x · 2026-09-11
John Lam shares the full setup behind an agent playing Factorio (via @MiraMira): a Linux VM runs both a headless and a GUI client. The headless one supports Lua scripts for reading game state and planning, while the GUI client records replays and save files, with the agent taking screenshots and interacting via bash('xdotool ...') or Python equivalents. Custom MCP servers existed for distributing work to an agent fleet and managing persistent sessions, but none were needed — stock Codex with no custom MCP servers could do the task.
Related event: John Lam Compares AI Agents' Factorio Progress Over 18 Months(2 posts)→
More from coding & agent
- Dev builds AI job-search app for his wife, she lands a job, and he open-sources it — CurieuxExplorer · 2026-10-28
- Meshy partners with MCP for Blender: agents drop textured 3D models into your scene — sidahuj · 2026-10-28
- Supercharging LLM classification with logprobs: soft classifiers you can threshold-tune — JnBrymn · 2026-10-28
- Codex daily build series day 23: skipping iCloud plugins for a reset — dotey · 2026-10-28
- Cloudflare Access adds fully customizable pages with HTML + Liquid templates — dinasaur_404 · 2026-10-28
- Opus retried every session 20.6 million times during a memory leak hunt — johnlindquist · 2026-10-28