Unattended GUI-Automation Trading Bots
Bots that read the game screen and deliver purchased in-game items to customers, running unattended for hours in production. Contract work for BloxPlaza.com; ongoing.
Status: ongoing contract role (2023–present) as Automation Engineer at BloxPlaza.com, an e-commerce business selling in-game items. Small team; I wrote most of the core, about 15,700 committed lines across 6 repositories (Python, JavaScript/Node.js, Lua).
What it does
The games have no programmatic interface for trading, so delivery has to happen through the game client itself. I designed and built GUI-automation bots that read the game screen and deliver purchased items to customers inside the game automatically. The system runs unattended for hours in production.
Platform
- BaseBot: a shared bot core, with game-specific trading bots on top (Adopt Me, TTD, and an AI-driven bot).
- Trade server (Node.js): coordinates bots and customers.
- claimSite: the web backend for bots, clients, mail and claims.
Design
- Explicit state machines. Bots are
IDLEorPROCESSING_TRADE; customers areWAITING,TRADING,WAITING_BOT_CHANGE,COMPLETEDorOUT_OF_STOCK. - Safe assignment. The server offers a waiting customer only to idle, non-scanning bots that have not already served them. Orders are split across bots by live stock, and both states switch before the trade starts, so no two bots can claim the same customer.
- No hanging orders. Items no bot stocks get an out-of-stock message instead of leaving the customer waiting.
- Controlled shared state. A shared lock lets keep-alive and shutdown act only when a bot is idle. Errors send an alert with a screenshot and reset the bot cleanly.
The hardest bug
An early version crashed reliably at the 23-minute mark. I traced it to a race: two asynchronous event handlers could call the Windows screenshot API at the same moment through separate screenshot objects. I put screen capture behind a single lock, then designed the rest of the system so shared state is touched only under explicit control. That discipline is what lets it run for hours without supervision.