← 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: Answered => Open

MP is still having a problem:
I tested a lot this morning. And I also used your icon. With the icon
and other tests I conclude that the code works when 1 frame, screen
change happens.

But from the moment there is an animation (so more frames changes in a certain time) it gives the double onchange effect. You can easy try my test: use the code:
==========================================================
def changed(event):

        print "something changed in ", event.region
        for ch in event.getChanges():
                ch.highlight() # highlight all changes
        wait(1)
        for ch in event.getChanges():
                ch.highlight() # turn off the highlights
        event.repeat(6)

r = Region(Region(614,711,729,60))
# any change in r larger than 50 pixels would trigger the changed function
r.onChange(300, changed)
wait(6)
# another way to observe for 30 seconds

r.observeInBackground();wait(FOREVER)
==========================================================
, make the whole screen the region, play a you tube vid for 3 seconds. Then stop it. The timer in this code is put on 6 repeat and 6 wait. So it should only give 1 onchange effect, but it gives 2.

Hopefully this helps

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