screen

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
NameTypeRequiredDefaultDescription
x1integerRequired—Left
y1integerRequired—Top
x2integerRequired—Right
y2integerRequired—Bottom
threshold_pctnumberOptional5.0Minimum change % to trigger
timeout_snumberOptional10.0Timeout seconds
toleranceintegerOptional0
Return Values
TypeDescription
booleantrue if region changed beyond threshold
Example
lua
if screen.wait_change(0, 0, 750, 200, 10, 5) then sys.log("Changed!") end