pb after observeInBackgroud

Asked by Eric BARROT

Hi

Win10 Pro last release, Sikuli ide 2.0.4

this is the script...
ErrComm Exists but sikuli don(t see it
it means that the script pass after print("1")
TeamV doesn't exist, it's ok, but...
it doesn't click on ErrComm... and don't print 2
it's happend in BueStacks...

def changeXX(event):
    #RegEventXX.stopObserver
   # while not exists(ErrComm): print("raté")
    print("1")
    while exists(okTeamV):
        click(okTeamV)
    while exists(ErrComm):
        click(ErrComm)
    while exists(Debloc): click(DeblocOk)
    if not exists(ErrComm):
        print("2")

  # RegEventXX.observeInBackground(FOREVER)

# imprévu
RegEventXX.onChange(5, changeXX)
RegEventXX.observeInBackground(FOREVER)
# fin imprévu

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was originally filed as bug #1916361.

Revision history for this message
RaiMan (raimund-hocke) said :
#1

observeInBackground runs as a subtask.

hence your script has to continue with some non-action to let observe make its job

simplest: wait(FOREVER)

... but then you have to kill the script run.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

invalid use