wait_for
Waits until an event matching topic and match happens, and returns it. Use it instead of sleeping and reading the log.
The answer has found, the event, and next, the cursor after it. If time runs out, found is false and the answer says what is known of why nothing came (for example, the game is paused).
Read-only: it changes nothing in the game. A call may take up to timeoutMs milliseconds, 30000 by default.
Arguments
| Name | Type | Required | What |
|---|---|---|---|
topic | any | A topic (“eluvian.command.ended”), a prefix (“mymod.”), “”, or an array of these. Default: every topic. | |
match | object | Payload fields the event must have, with equal values; nested objects match as subsets. Creatures are ids like “0x7d9”: {“id”: “0x7d9”}. | |
since | integer (≥ 0) | Look for events from this cursor on. Pass the cursor from the answer of the call that set things off, so an event that came before the wait is not missed. Default: from now. | |
timeoutMs | integer (≥ 0, ≤ 300000) | How long to wait, in milliseconds. Default 30000. |
Call it as wait_for over MCP, or POST /api/tool/wait_for with the arguments as JSON.