← Back to team overview

sikuli-driver team mailing list archive

[Question #186639]: Can't Figure loop!

 

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

Hi everybody! Can't figure how to make loop my code for 1 minute.. it's just checking for 1 minute if exists the image.. but when it exists it just saves the file and turn off. without first break it gives me an error!
I need for example to this loop saves ~60 files for 1 minute if the picture exists this minute!
Not a pro in programming, but can't understand how python loop is working correctly.. in delphi code i can do it, but here is different.. in delphi after saving .png i can sent app to beginning of procedure or etc.. but here is harder to me (but in real maybe it's easy) 
:(  I'm reading the faq's and manuals.. but can't make it working. 

import shutil
reg1 = Region(194,392,179,103)
start = time.time()
end = start+60
while True:
    mImg1 = reg1.exists("DUDE.png",0)
    if mImg1: break
    img = capture(SCREEN)
    shutil.move(img, 'c:/test/')
    wait(1)
    if time.time() > end:break

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