← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #240213]: How to know a specific image found on a if exists with an array

 

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

RaiMan proposed the following answer:
You have to modify your existsAny, to return the index of the found
image, otherwise -1

def existsAny(reg, imageList):
#    for img in imageList:
    for n in range(len(imageList)):
        if (reg.exists(imageList[n], 0)):
            return n
    return -1

and check/use the return value accordingly.

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