← Back to team overview

sikuli-driver team mailing list archive

[Question #201429]: HELP... how to click 2 diferent images in one region untill they disappear.

 

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

hi, im new in the sikuli program soo...  i will be so pleased if u help me out with this
i need a script tha allows me to click infinite times to an image and when this one its gone change to the next image utill its gone, thing is that i have to do many stuff in between this,  so the way i do it gets so so slow (and yes im using regions)   

example (what i have)... (i will avoid here the region. ext)

"""some times in img1 and img2, some stuff happens so i have to add many if'ss and while'smore to complete the action  "A" ,"B" and so on.. 
NOTE: the many if's and while's  such a "A", "B"   are the same in img1 and img2 """


while exists(region(img)):
   if exists(img1):
      click (img1)
      if exists(A):
           click(A)
      while exists (B):
             if exists (B)
                click (B)  ----  and so on---
          
   if not exists (img1):
     if exists(img2):
        click(img2)
       if exists(A):
           click(A)
      while exists (B):
             if exists (B):
                click (B)  ----  and so on---
        if not exists(img2):
        click(img 3) --- """this one represents a change of region where everything starts all over again""


so i was wondering if there is a way to avoid to write same instructions for img1 and img2  to maybe make it faster .....maybe smth like this but working :P 

while exists(region(img)):
   if exists(img1 or img2):
      click (img1 or img2 )
       ""then here agian all the ifs "A" "B"  """
           if exists(A):
           click(A)
      while exists (B):
             if exists (B):
                click (B)  ----  and so on---
        if not exists(img2):
        click(img 3) ---
 

Thanks!

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