New question #664865 on Sikuli:

I've defined a sikuli module which is used to click on an image when something 
appears inside a region.


    from sikuli import *
    class Observer:

        # When "observedImage" appears inside "region", double click on 
        def __init__(self, region, observedImage, reactImage):
            self.region = region
            self.observedImage = observedImage
            self.reactImage = reactImage
        def start(self):
            self.region.onAppear(self.observedImage, self.appearHandler)
            self.region.observe(FOREVER, background = True)
        def appearHandler(self, event):
        def stop(self):

Here's how to use it:

    import observer
    import time
    observer.Observer(Region(111,222,333,444), "imageToBeDetected1.png", 
    observer.Observer(Region(555,666,66,666), "imageToBeDetected2.png", 

    while True:
The problem with the above code is that when `imageToBeDetected1` and 
`imageToBeDetected2` both appear in `Region(111,222,333,444)` and 
`Region(555,666,66,666)` respectively, my mouse will move between 
`imageToBeClicked1` and `imageToBeClicked2`. I want only `imageToBeDetected1` 
to be clicked in this situation. 

`imageToBeDetected2` should be ignored when `imageToBeDetected1` and 
`imageToBeDetected2` both appear in `Region(111,222,333,444)` and 
`Region(555,666,66,666)`, respectively.

How can I modify my code so that `imageToBeDetected1` has a higher priority 
over `imageToBeDetected2`?

Or is there a better way to observe multiple images with sikuli?

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

Mailing list:
Post to     :
Unsubscribe :
More help   :

Reply via email to