← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #256328]: While with rules

 

Question #256328 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/256328

    Status: Open => Answered

RaiMan proposed the following answer:
something to evaluate and play with

myApp = App("Application")

if not myApp.window():
  popup("Application is not running")
  exit()

"""
then, i need get popup with input value of random - entered value is assigned to random
random.randint(entered value in popup)
t = random.randint

not clear what you want to achieve
random.randint needs a range (a, b) wher the random integer should vary in
"""
# get a number from the user
try:
  val = input("give me a number value")
  val = int(val)
except:
  popup("input given is not a number")
  exit()
t = val

myApp.focus()

#start while
while True: # outer loop
  while True: # inner loop
    wait(t)
    click(img)
    wait(1)
    
    # click(img)
    #    if img is not exist return to start while
    #    if img is exist continue
    
    if exists(img):
      click(img)
     else:
       break # leave inner loop
     
    wait(1)
    
    # click(img)
    #    if img is not exist return to start while
    #    if img is exist continue
    
    if exists(img):
      click(img)
     else:
       break
    
    # delete all files from folder C:\0000\ by quiet cmd or something else
    # has to be realized with Python file system features.
    break 
  pass # here we get at success of inner loop or after a break
  # now outer loop repeats and again starts inner loop

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