glass_wait_for_region
Wait for a screen region to change or match a saved baseline, returning match status, change percentage, bounding box, and elapsed time. Use it to pause automation until a visual transition completes or times out.
Instructions
Wait for pixel transition completion: changes from the initial frame or matches a saved baseline (required for matches). Returns matched, changed_pct, bbox and elapsed_ms as text; include_image opts into an image on match. Timeout returns matched:false. Does not prove semantics or subsequent quiescence; use a settle action for the latter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | "perceptual" (default) or "exact". | |
| until | No | "changes" (default; diverge from reference) or "matches" (converge to baseline). | |
| ignore | No | Window-relative excluded rects intersected with region. Off-area rects clamp/drop silently; check ignored_pixels. changed_pct uses remaining pixels. | |
| region | No | Window-relative sub-rectangle to watch; omit for the whole window. | |
| baseline | No | Saved baseline name to compare against; omit to use the frame at call start. | |
| max_width | No | Maximum returned image width; shrinks after crop, preserving native comparison pixels. | |
| threshold | No | Perceptual sensitivity (default 0.1; smaller = stricter). | |
| tolerance | No | Exact per-channel tolerance (default 0). | |
| window_id | No | Observe this current glass_list_windows ID without selecting it; omit for active window. | |
| max_height | No | Maximum returned image height; omit both limits for native output. | |
| timeout_ms | No | Give up after this long (default 10000ms); returns `{matched:false}`. | |
| interval_ms | No | Poll interval (default 100ms). | |
| include_image | No | On match, also return the watched region as an image (default false). |