← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #200281]: screenshot compare in java

 

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

j posted a new comment:
This is a little over the top...

I think you can simplify this with Sikuli's observe function, here's an
example:

def doOnChange(event):
   # do something when the screen changes

Settings.ObserveScanRate=0.1 # scan every 10 seconds
onChange(doOnChange)
observe(11) # observe for 11 seconds


This example sets the scan rate to 1 scan/10 seconds and runs the onChange-observer on the SCREEN object for 11 seconds. 
If the screen changed, the doOnChange() method is executed. Notice, that it has to take the event-argument which will be passed and which contains info about where the change occured on the screen. 
For more info, read this: http://sikuli.org/docx/region.html#observing-visual-events-in-a-region

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.