← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #631611]: How to modify a variable without stopping the Sikuli script?

 

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

    Status: Open => Answered

masuo proposed the following answer:
How about using Hotkey?
Prepare the file, and enter ctrl key and m key at the same time.

[sample codes:]
#-----this function must be changed to read variables from file
def Read_Variables():
    v = []
    v.append(5) #WaitTimeout
    return v

#-----Hotkey handler
def Modify_Variables(event):
    v = Read_Variables()
    setAutoWaitTimeout(v[0])
    
#-----Main script
Env.addHotkey("m", KeyModifier.CTRL, Modify_Variables)
while True:
    if not exists("image.png"):    # The processing here changes (3 -->5)
        popup("Click to continue")

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