← 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

Description changed to:
So I have a loop that's looking for an image that slowly changes over
time, slowly changes back, so need it to look for them in sequence.

Here's an example of what I have with just two images, there's actually
way more images in the real loop.

"print('1st loop')
while True:
    if exists(Pattern("1505851538186.png").targetOffset(-12,-37)):
        print('found 1st image at 1st loop')
        break

    elif exists(Pattern("1521782392359.png").targetOffset(-8,-33)):
        print('found 2nd image at 1st loop')
        break
    else:
        print('none of the images found at the 1st loop')
        #something that will lower the match by 1%
        continue
hover(getLastMatch())"

Exactly what the match percentage should be is getting hard to pin down, so would like it to start at 99% and after it hits tge bottom of the loop the percentage for all patterns gets lowered to 98% and so on.
I know how to program it to stop when the match gets to low, at that point I'll add another pattern.

I found this "https://answers.launchpad.net/sikuli/+question/256236";

So I assume the solution is to do with .similar, I've already been able
to turn one images 99% into 98% right there on the same line, but that
means it never looked for it at 99%

So not sure yet how to just lower the match at the bottom of the loop.

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