screen.screen.wait_change
Declaration
lua
screen.wait_change(x1, y1, x2, y2 [, threshold_pct, timeout_s, tolerance])
Description
Wait for screen region to change by at least threshold percentage. Takes initial snapshot, polls every 100ms.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
x1 | integer | Required | — | Left |
y1 | integer | Required | — | Top |
x2 | integer | Required | — | Right |
y2 | integer | Required | — | Bottom |
threshold_pct | number | Optional | 5.0 | Minimum change % to trigger |
timeout_s | number | Optional | 10.0 | Timeout seconds |
tolerance | integer | Optional | 0 |
Return Values
| Type | Description |
|---|---|
| boolean | true if region changed beyond threshold |
Example
lua
if screen.wait_change(0, 0, 750, 200, 10, 5) then sys.log("Changed!") end