← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #658596]: Lower pattern match within a loop on repeat

 

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

Manfred Hampl proposed the following answer:
If I interpret your question correctly, then you are looking for
something like

print('1st loop')
mySimilarity = 1.0
while True:
    if exists(Pattern("1505851538186.png").similar(mySimilarity)):
        print('found 1st image at 1st loop with similarity %f') % mySimilarity
        break
    elif exists(Pattern("1521782392359.png").similar(mySimilarity)):
        print('found 2nd image at 1st loop with similarity %f') % mySimilarity
        break
    else:
        print('none of the images found at the 1st loop')
        mySimilarity = mySimilarity - 0.05 # reduce by 5%
        continue
hover(getLastMatch())

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