editor_wait_for
Waits for the first matching editor event, optionally filtered by text, and returns it or a timeout result. Use it to synchronize with play mode, reloads, or log output.
Instructions
Waits for the first editor event of a kind (see editor_events), optionally with a text, and returns it. Without sinceSeq it waits for an event after the call; with it, an event already recorded after that number counts. A timeout is a result (TimedOut true), not an error. Example: start play with editor_play_mode, then editor_wait_for kind=log textContains="[Test]" to read a game's answer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | The event kind, e.g. play_begin, reload_end, log. | |
| sinceSeq | No | Count events after this sequence number; omit to wait for a new one. | |
| textContains | No | Only an event whose text contains this (ordinal). | |
| timeoutSeconds | No | How long to wait, up to 600 seconds. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event | Yes | ||
| lastSeq | Yes | ||
| matched | Yes | ||
| seconds | Yes | ||
| timedOut | Yes |