← Back to team overview

sikuli-driver team mailing list archive

[Question #193556]: Repeat previous step if a image is not found

 

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

So there is game on my Facebook which I'm trying to automate.
So what I need is  keep on clicking  2 images ( with a time gap of 2sec). 

So lets say  img1  and img2 .

Now here img2 appears only if img1 is clicked (img1 is always there) 

So I want to click on img1 and then img2 then sleep(2)  and then repeat this infinite times .

Now I don't trust this script. What I want is , After clicking img1  if img2 is not found, I want it to repeat click img1 ( click until img2 comes) 

This is what I tried with 

x=1
while (x < 2):
 while not find(img2):
  click(img1)
 click(img2)
sleep(3)


 But this is not executing just because it says  cant find image (img2) at line 3. 

But actually if it cant find image, why is the script stopping? doesn't it have to go inside while ? 

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