← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #195347]: wait for image A or wait for image B

 

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

RaiMan posted a new comment:
Uuups copy&paste error and a logical flaw, so once again:

def handler(e):
    global isImgA_or_ImgB
    isImgA_or_ImgB = True

RegA.onAppear(imgA, handler)
RegB.onAppear(imgB, handler)

while True:
    RegA.observe(FOREVER, background=True)
    RegB.observe(FOREVER, background=True)
    isImgA_or_ImgB = False
    while not isImgA_or_ImgB:
        wait(1)
    RegA.stopObserver()
    RegB.stopObserver()
    click(imgA)

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