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

sangzh posted a new comment:
I have traced the code, the function exits when the result is isMatch, so the 
code has not problem.
The problem is that: after the image is found, the following will click the 
image, but it dose not click the image.
I think the reason is that there is a delay after the image is found, and the 
image dose not display when excute the click. So add wait(1) before break the 
function, then it can work well.
the code is:
def waitFor(img):
    weWait=30
    while weWait > 0:
        result = exists(img,0)
        if result:
            wait(1)
            break
        wait(1)
        weWait-=1
    if not result:
        print "image did not appear"
        exit(1)

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

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to