{“content”:”---\nname: pokemon-red-windows-pc\ndescription: Windows PC 上用 PyBoy 代玩 Pokemon Red (GB) — SSH 远程控制模拟器\n---\n\n# Pokemon Red 代玩 (Windows PC)\n\n## 环境准备\n1. ROM: D:\\Games\\Pokemon\\PokemonRed.gb(必须是 GB 格式,非 GBA)\n2. Python: PC 上已安装 Python(系统级,非 venv)\n3. PyBoy: pip install pyboy(装到系统 Python)\n\n## 步骤\n\n### 1. 安装依赖\nbash\npip install pyboy\ngit clone https://github.com/cmacmou/pokemon-agent.git\ncd pokemon-agent\npip install -r requirements.txt\n\n\n### 2. 启动 PyBoy 模拟器\nbash\ncd C:\\Users\\sozo\\pokemon-agent\nstart /b cmd /c \"pyboy --no-gui --window-type null D:\\Games\\Pokemon\\PokemonRed.gb\"\n\n注意:--no-gui --window-type null 开启无头模式,SSH 也能运行。\n\n### 3. 启动 API 服务器\nbash\npy -m pyboy_server\n\n端口 8000。\n\n### 4. API 调用\n- 截图: GET http://localhost:8000/screenshot\n- 状态: GET http://localhost:8000/state\n- 生命值: GET http://localhost:8000/health\n- 按键: GET http://localhost:8000/action?btn=A(btn: A/B/START/SELECT/UP/DOWN/LEFT/RIGHT)\n\n### 5. 远程访问(需要 SSH 端口转发)\n从 Termux 端:\nbash\nssh -L 8000:localhost:8000 [email protected]\n\n\n## 已知问题\n- mGBA 不能用 PyBoy,需要 Pokemon Red GB 格式 ROM\n- SSH 前台运行模拟器会卡住,必须用 start /b 后台启动\n- PyBoy pip 包安装在系统 Python,venv 里没有”}