프로젝트 소개
Pokex is a personal project demonstrating how to build a reliable automation system for a hostile, API-less environment using Elixir and OTP. Designed for a 2D tile-based MMORPG on macOS, it perceives the game state through screen captures and acts via synthetic mouse and keyboard events. The architecture relies on a supervision tree with 26 GenServers and 3 supervisors, emphasizing process isolation and message passing to handle real-world constraints like input latency, race conditions, and system contention.
Key engineering challenges addressed include:
- **Scarce Resources:** Screen capture is serialized through a single GenServer to avoid macOS contention, ensuring consistent timing.
- **Destructive Actuation:** Input is managed by a dedicated 'Body' process and a fail-closed 'InputGate' to prevent stray keystrokes when focus is lost or processes crash.
- **Pure Logic:** Decision-making modules are separated from I/O drivers, allowing exhaustive testing of game logic without a running client or screen.
- **Safety:** An external 'Guardian' process monitors for emergency stop conditions (e.g., cursor in a kill corner) and can halt the entire fleet independently of worker states.
The project uses Phoenix LiveView for a local control panel and includes native Swift helpers for low-latency input and screen capture. While it includes calibration tools, it is not packaged as a general-purpose product and requires significant reconfiguration for different machines or game clients. The repository serves as an OTP case study, with over 37k lines of tests ensuring reliability in the logic layer.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.