How to modify a variable without stopping the Sikuli script?

Asked by Milteven on 2017-05-07

Hello, I'm monitoring a sikuli script that is running in another computer through emails BUT sometimes I want to modify a varyable in that script WITHOUT stopping the execution, is this possible?

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2017-05-07
Last reply:
2017-05-07
masuo (masuo-ohara) said : #1

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")

Can you help with this problem?

Provide an answer of your own, or ask Milteven for more information if necessary.

To post a message you must log in.