← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #268536]: image click on multiple appearances

 

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

Eugene Maslov proposed the following answer:
A quicker one:

myGame=Region(0,0,800,600)

def myChange(event, region=myGame):
    
    myattack=region.exists("attack.png",0)  
    if myattack is not None:
        myattack.click()       
    else:
        mycontinue=region.exists("continue.png",0)  
        if mycontinue is not None:
            mycontinue.click()
        else:
            myrestart=region.exists("restart.png",0)
            myrestart.click()        

myGame.onChange(50,myChange)
myGame.observe(30,False)

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