spawn_play_input
Send keyboard and mouse actions to control the game, move, jump, and click UI elements. Screenshot first to locate UI buttons when direct clicks are blocked, then capture a screenshot to verify results.
Instructions
Send keyboard/mouse actions to the play session (WASD, jump, click UI, etc.). Clicks the canvas center ONCE per session to give it keyboard focus — later batches send only the actions you list, so no stray clicks fire your weapon or dismiss UI. This is also the ONLY way to click your game's UI (ui.js renders into a cross-origin iframe that spawn_play_eval cannot reach): screenshot first, read the button's position off the image, then click those coordinates. After acting, call spawn_play_screenshot to see the result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | jpeg (default) is 7-14x smaller on lit/textured 3D scenes (~1.3MB png vs ~90KB jpeg) and reads the same. Prefer png for flat-shaded or pixel-art worlds, where large uniform areas compress better losslessly, or when you need exact pixels. | jpeg |
| actions | Yes | Ordered list of input actions | |
| quality | No | JPEG quality 1-100 (ignored for png) | |
| refocus | No | Force a canvas-center click before the actions (use if the game lost keyboard focus). Fires a real left click. | |
| screenshot | No | Screenshot after the sequence |