← Back to team overview

sikuli-driver team mailing list archive

[Question #273340]: Observe region until it stops changing

 

New question #273340 on Sikuli:
https://answers.launchpad.net/sikuli/+question/273340

I've looked through some other similar questions, and it seems doable in Python/Jython to observe the region until it stops changing and call it to stop observing. 

I'm writing the script in Java and I've looked through the documentation but I can't seem to find anything that can allow the handler to identify when no changes has been detected. This is my code at the moment, it will simply stop printing 'Changes detected' if there are no changes on the region.  

ObserverCallBack event = new ObserverCallBack(){
            @Override
            public void changed(ObserveEvent e) {
                System.out.println("Changes detected");
                region.wait(1.0);        
            }
        };
        
 region.onChange(50, event);
 region.observe();      

How can I get the handler to stop observing once there are no changes detected?

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