[Sikuli-driver] [Question #269175]: It does not work onAppear

2015-07-13 Thread Chp
New question #269175 on Sikuli:
https://answers.launchpad.net/sikuli/+question/269175

Hello
I'm using Sikuli 1.0.1 
my code:
def my_handler(event):
print My handler, event.match

dz.scr.onAppear(Interface.Loading['play_w7'], my_handler)
dz.scr.observe(60, True)

for i in range(30):
print('--' + str(i))
sleep(0.5)

If my handler works out at least once, it does not work next time when it finds 
required image. And I forced to run it this way:
def my_handler(event):
print My handler, event.match
dz.scr.stopObserver()
dz.scr.observe(60, True)

Do I do it right or there is another way?

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #269175]: It does not work onAppear

2015-07-13 Thread RaiMan
Question #269175 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/269175

Status: Open = Answered

RaiMan proposed the following answer:
if you want to reliably use observe, I recommend to use version 1.1.0
(http://sikulix.com).

I do not support problems in 1.0.1 with observe anymore.

in 1.1.0:

- onAppear, onVanish in 1.1.0
... stop observing after the first success
... need an event.repeat(waittime) before leaving the handler, if you want to 
continue the observe
... to stop the observe in handler: event.stopObserver()

Never ever start an observer inside of a handler !!!

def my_handler(event):
print My handler, event.match
event.repeat(2)

dz.scr.onAppear(Interface.Loading['play_w7'], my_handler)
dz.scr.observe(60, True)

for i in range(30):
print('--' + str(i))
sleep(0.5)

The docs for the new observe in 1.1.0 will be available tomorrow.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #269175]: It does not work onAppear

2015-07-13 Thread Chp
Question #269175 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/269175

Status: Answered = Solved

Chp confirmed that the question is solved:
I am not ready yet to upgrade to version 1.1, I tried but it did not
solve the problem of click to for app unity3d player

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #269175]: It does not work onAppear

2015-07-13 Thread Chp
Question #269175 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/269175

Chp confirmed that the question is solved:
Thanks RaiMan, that solved my question.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp