← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #654441]: multiple screenshot analysis in a script

 

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

arminius posted a new comment:
Thanks Manfred you are the man.

This came extremely close "while True:
  if exists(Pattern("image seen as of monday").targetOffset(-16,-58)):
      print('found 1st image')
  elif exists(Pattern("image seen as of tuesday").targetOffset(-16,-58)):
      print('found 2nd image')
  elif exists(Pattern("image seen as of wednesday").targetOffset(-16,-58)):
      print('found 3nd image')
  else:
      print('none of the images found')
      break # retry from the beginning
  hover(getLastMatch())
  #do the real action"

I slotted a screenshot into the 1st position, it hung, I thought that's
odd that the first one would pass out of favor so fast.

In the console it was printing found 1st image over and over, so I knew
it was finding it fine.

I added break under every instance of print and it worked perfectly.

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