← Back to team overview

sikuli-driver team mailing list archive

[Question #231016]: Simple Code - Exception Problem

 

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

Hi, I'm kinda new to Sikuli and I've checked the guide but the code doesn't really work from the guide. I must be putting it in wrong.

Anyway here's the problem. 

1  object 1 = exists(image.png)
2  while object: 
3    click(image.png)
4    wait(5)

5 object_2 = exists(image_2.png)
6    click(image_2.png)

So what code do you put in so that if it can't find image.png it will go to image_2.png. Everytime I run the code and image.png disappears I get the error: 

[error] script [ code ] stopped with error in line 4
[error] FindFailed ( can not find P(1371649544991.png) S: 0.38 on the screen. )

Also anyway to reset the code so it restarts from the beginning once image_2.png disappears as well.

Thank you, in advance.


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.