← Back to team overview

sikuli-driver team mailing list archive

[Question #186411]: wait 1 or 2 or 3 and loop it

 

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

Hi everybody! First day in Sikuli and it is what i have searched for 3 months!!! Grate thing! but have a problem
My app needs to search for 3 small images, one of these that might appear in 1 region of the screen. And i have other 3 small images what can appear in other 2 regions at the screen (i have just 3 regions at screen where need to scan), when it is appeared it is taking screenshots.. and start to search if again and it will be waiting while i do not press some shortcut key for example (ctr+0) or something like that... 
for now i'm trying to make search of 1 or 2 image.. and it's working too long and timer is not work correctly (or not working)? 
please help me, please! 

import shutil
weWait = 20
while weWait > 0:
  mImg1 = exists("0000-1.png",0)
  mImg2 = exists("DUDE-1.png",0)
  if mImg1 or mImg2: break
  wait(1)
  weWait -= 1

if not (mImg1 or mImg2):
  popup ("nothing to screen"); exit(1)

if mImg1:
    img = capture(SCREEN)
    shutil.move(img, 'c:/test/')
if mImg2:
    img = capture(SCREEN)
    shutil.move(img, 'c:/test/')

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