Merge pull request #351 from ludovic111/feat/agent-waits

Agent control: wait for a state, and the log of what happened
This commit is contained in:
Ludovic Marie
2026-10-15 17:43:54 +02:00
committed by GitHub
9 changed files with 418 additions and 4 deletions
+7
View File
@@ -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