← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #680137]: repeat([waitTime]) how is this syntax with a region onchange?

 

Question #680137 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/680137

    Status: Open => Answered

RaiMan proposed the following answer:
Nice try ;-)

... but when you stop the video after 3 seconds, then there are changes against the first shot, that reported the first changes after starting the script. 
This then leads to the second changes after waiting the 6 seconds from the repeat.

the wait(6) before the observe only leads to that the observation is
delayed 6 seconds after script start.

since you have a  wait(FOREVER) in your script, it runs until killed by
hand.

but after the second change event, there are no more changes.

To make it a bit clearer - this happens internally:
- at observestart a shot of the region is taken
- then with the ObserveScanRate it repeats looking for changes against the first shot
- if changes are detected, the last shot is saved and becomes the new reference and the handler is called
- if the handler returns normally, the observe will be repeated after the optional wait time

Your problem simply is, that you do not decide in the script when to
stop the observation and/or the script.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.