Re: [Sikuli-driver] [Question #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 RaiMan proposed the following answer: @panadol007 fixed - see the related bug and https://github.com/RaiMan/SikuliX1/issues/270 will be available in 2.0.2 (start of January) and in 2.1.0 nightly later today -- You received this question notification because your team Sikuli Drivers 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 panadol007 proposed the following answer: Noted. TQVM -- You received this question notification because your team Sikuli Drivers 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 RaiMan proposed the following answer: ok, I have to put the bug alive again and check. -- You received this question notification because your team Sikuli Drivers 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 panadol007 proposed the following answer: @Raiman, Thanks for the quick respond, I'm currently using SikulixIDE 2.0.1 Remote Desktop into Windows 7 -- You received this question notification because your team Sikuli Drivers 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 RaiMan proposed the following answer: @panadol007 as mentioned in the related bug: use 1.1.4+ ... which currently is 2.0.1 -- You received this question notification because your team Sikuli Drivers 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 Status: Open => Answered panadol007 proposed the following answer: Thanks for the good tool RaiMan, I run into the same problem too. setInactive / setActive not functioning, event.repeat() will trigger the event handler continuously. Are there any fix for this yet? -- You received this question notification because your team Sikuli Drivers 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 Status: Open = Answered RaiMan proposed the following answer: ok, then I have to say sorry and do my homework: have a look, what really goes on there. Watch for a fix the next days on nightly or a comment on this question. Hope I can fix it before I am away for 3 weeks vacation ;-) -- 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 Status: Answered = Open Tetsuo is still having a problem: np. Thanks RaiMan. Ill wait 4 the fix. -- 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 Linked to bug: #1476773 https://bugs.launchpad.net/bugs/1476773 [1.1.0] observe: setInactive/setActive not working -- 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 Status: Open = Answered RaiMan proposed the following answer: Generally: you should not use popup in a handler (disturbs what is going on on the screen and steels focus) use print instead sorry for misleading: it must be event.getRegion().whatever BTW: the docs are up to date http://sikulix-2014.readthedocs.org/en/latest/region.html#observing-visual-events-in-a-region your solution should work so. -- 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 Tetsuo gave more information on the question: Well, It seens, from the docs, i cant access region atribute and have to use getRegion() Its not working either: if event.isAppear(): popup(APPEAR) appear_region = event.getRegion() appear_region.setInactive(appear_handler) when using myRegion.setInactive(appear_handler) its seens to be working. myRegion is a global variable that stores the region. Thanks. -- 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 RaiMan posted a new comment: run with Debug.on(3) at the beginning of the script. Maybe the log tells something. -- 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 Tetsuo gave more information on the question: Ok. Here is the result: Code: def myHandler(event): print(APPEAR) event.getRegion().setInactive(appear_handler) event.repeat() Main: appear_handler = myRegion.onAppear(avatar,myHandler) Output: debug] Observer: APPEAR: 1437486889624 with: Avatar.png at: M[192,161 44x43]@S(S(0)[0,0 1440x900]) S:1,00 C:214,182 [33 msec] [debug] Image: reused: Avatar.png (file:/D:/USERS/tetsuo/Desktop/Pessoal/BOT/MAIN.sikuli/Avatar.png) [debug] Observer: running call back: APPEAR APPEAR [debug] Observer: repeat (APPEAR): 1437486889624 after 1 seconds After printing APPEAR it goes to the repeat in debug. Is setInactive supposed to print something in Debug mode? Its not working. The script keeps printing APPEAR. I have deleted everything in the script to make it as simple as possible. Thanks. -- 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 Status: Answered = Open Tetsuo is still having a problem: Hi, It doesnt seen to be working. Maybe i misunderstood your tips. Here is my code: def myHandler(event): if event.isAppear(): popup(APPEAR) event.region.setInactive(appear_handler) event.region.setActive(vanish_handler) elif event.isVanish(): popup(VANISH) event.region.setInactive(vanish_handler) event.region.setActive(appear_handler) event.repeat() in the main program: appear_handler = myRegion.onAppear(avatar, myHandler) vanish_handler = myRegion.onVanish(avatar, myHandler) myRegion.observe(FOREVER, background=True) Popup APPEAR keeps showing on screen when the avatar is showing. So i guess setInactive is not working. Am i doing it righ? Setting it Inactive after repeat does not work either. Thanks. -- 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 #269185]: OnAppear and OnVanish on the same region
Question #269185 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269185 Status: Open = Answered RaiMan proposed the following answer: Yep, there is a feature, which is not yet in the docs. Each observer onXXX gets a unique name, that is registered at time of creation. With this name one can later access this observer. obsAppear = region.onAppear(...) obsAppear now contains the name of this specific observer obsVanish = region.onVanish(...) same here now you can say in the handler: event.region.setInactive(obsAppear) and event.region.setActive(obsAppear) setActive() returns the observer to the same state as if it had run the first time. Try it out, I did not fully test it yet. -- 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
[Sikuli-driver] [Question #269185]: OnAppear and OnVanish on the same region
New question #269185 on Sikuli: https://answers.launchpad.net/sikuli/+question/269185 Hi again. Im writting a code that will check if an image appeared on a Region. After the image appears the program will scan the same region to see if it desappears. When the image desappears it will start to scan to see if it appears again, and so on. So, im using OnAppear and OnVanish on the same region with a single handler. (calling Repeat() in the end) The problem with this solution is that the handler will continue to be called with type = APPEAR even if the handler was already triggered one time with APPEAR. The same happen when the image disappears and the handler is called with type = VANISH. It will continue to be called with VANISH until the image appears again. Is there a way to avoid this? Is it possible to unregister OnAppear/OnVanish and register it again in a Region? Do i have to use two different regions with the same dimmensions? Thanks -- 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