← Back to team overview

sikuli-driver team mailing list archive

[Question #271462]: If Exits(() finds pattern that is not there

 

New question #271462 on Sikuli:
https://answers.launchpad.net/sikuli/+question/271462

I have developed a script, very simple, to automate clicking buttons in a game when an initial image appears.  I want this to keep checking forever.  Here is the script:

1  App.focus("Andy")
2  while True:
3      if exists(1.png, FOREVER):
4          click(1.png) #Click button that has appeared
5          click(2.png) #Click button on second screen that opens after first button click
6          click(3.png) #Click button on second screen that returns it to the first
7      else:
8          pass
9      wait (10)

The problem is, the first time through it works fine. But after that, the script progresses to line 5 and returns an error that 2.png can't be found.

Why does it even go to that line when 1.png is not present?

Thanks for any help!

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