← Back to team overview

sikuli-driver team mailing list archive

[Question #403018]: Pass value from handler (on appear) to main script

 

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

Hello and really thanks for support.!!

Im trying to get the value from the handler to my main script. So when an observe is happen i can send my script flow to any direction....

The philosophy is to catch errors while the script is running and if so to call specific functions.

*Im not a great programmer thats why i'v been stuck.. and need help please... :)

My code:

#functions popup
def p1():    
    popup("hi1")

def p2():
    popup("h2")

def p3():
    popup("h3")  

def p4():
    popup("h4")

def p5():
    popup("h5")

#check if handler is activated
if myvar == 22:
    p5()
else:
    p1()


#handel for onappear
def handler():
    myvar = 11


#onappear method

onAppear("CalcImage.png", handler)
observe(FOREVER)
while True:
    observe()


The error ofcource: [error] NameError ( name 'myvar' is not defined )
*Working on Sikuli 1.1.0


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.