← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #229825]: do an action if the image on a region doesn't change

 

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

Greg83140 gave more information on the question:
I tried this code :

reg = myRegion

def pp(event):
    global toto
    toto = "change"
    print"change"


def fff():
    toto = "notChange"
    print "do my action"
    reg.onChange(pp)
    reg.observe(1)
    wait(4)
    if toto == "notChange":
        print"notChanged"

fff()

When my region isn't change, it works:
result : 
do my action
notChanged

but when my region change, it doesn't work:
result:
do my action
change
notChanged

why does the code goes to "notChanged"

Thanks by advance for your answer

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