Agent control: wait for a state, and the log of what happened
wait-for screen NAME|widget ID|loaded|chat TEXT|event KIND replies once the game gets there (--timeout, default 30 s, ends in an error of kind timeout; --since SEQ counts chat and events from an earlier point), so scripts and agents stop polling. events [--since SEQ] lists what happened, oldest first, numbered: screens, chat lines, deaths, respawns, items gained or lost, dimensions, worlds opened and closed. The state is compared once per event loop turn and only under --control, so watching never changes the game. respawn now says when the death screen's button is not active yet instead of clicking it to no effect. horizon-ctl and its MCP gain both; tools/agent_control_e2e.py gains an events scenario. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -134,6 +134,13 @@ game accepts, test hooks included.
|
||||
`key.keyboard.w`); `options-set KEY VALUE` sets one, applies it at once and
|
||||
saves `options.txt` as the options screen does. A value the option refuses
|
||||
is an error saying what it accepts, not vanilla's silent reset.
|
||||
- **Waits and events:** `wait-for screen NAME|widget ID|loaded|chat TEXT|event
|
||||
KIND [--timeout S] [--since SEQ]` replies once the game gets there (a timeout
|
||||
is an error with `"kind": "timeout"`), so scripts don't poll. `events [--since
|
||||
SEQ]` lists what happened, oldest first, each with a `seq` and the `tick`:
|
||||
`screen` (from, to), `chat` (text), `death`, `respawn`, `item` (item, delta),
|
||||
`dimension`, `world` (opened, closed). Take `last` from `events` before an
|
||||
action whose event you then `wait-for --since` it, so a fast one isn't missed.
|
||||
- **Screens:** `open-inventory`, `click-slot SLOT [right] [shift]` (0-8 hotbar,
|
||||
9-35 inventory, 100+ crafting grid, 200 result, 300+ containers, 500-503
|
||||
armor, 504 offhand, 600+ stations), `close`, `click-button LABEL` (any
|
||||
|
||||
Reference in New Issue
Block a user