If Exits(() finds pattern that is not there
Asked by
Thomas Geiger
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!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Thomas Geiger
- Solved:
- Last query:
- Last reply:
To post a message you must log in.