← Back to team overview

sikuli-driver team mailing list archive

[Question #243614]: Observe on Change event exits script or brings up IDE and continues running

 

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

I got my original code from a launchpad answer. The code works great... once.

I have the code looping, after the first run:
if started headless (command line) it just exits.
if started in the IDE, the IDE opens up (As if it finsihed), but the script continues to run.

I have no idea what i've done.

def changed(event):

    
    print "something changed in "
    sleep(1)
    Settings.isChanged = True
    event.region.stopObserver()
    doht()

def ht_level_change():
    
    htlevelReg = Region(1060,707,27,15)
    
    print "Checking bigScreen Video Region"
    r = htlevelReg
    r.onChange(10, changed)
    Settings.isChanged = False
    Settings.ObserveScanRate = 1
    r.observe(300, background=True)
    while Settings.isChanged == False:
        type('5')
        sleep(1.4)
     # observing for 5 seconds (script pauses here)
    

def doht():

    sleep(2)
    ht_level_change()
doht()

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