[Sikuli-driver] [Question #269110]: Handler Type test
New question #269110 on Sikuli: https://answers.launchpad.net/sikuli/+question/269110 Hi. In the OnVanish and OnAppear handle how im able to test what is the type of event that happened on the screen. def myhandle(event): if event.type == "VANISH": if event.type == "APPEAR": does not work. Sorry if its a basic question. Im new to all of this. 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 #269110]: [1.1.0] observe: Handler Type test
Question #269110 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269110 Status: Answered => Open Tetsuo is still having a problem: Humm..sorry if its to obvious, but what is ObserveEvent? I thought the handler receives SikuliEvent as a parameter. Also, event.getType() does not seen to work. Here is my code def MyHandler(event): print event.type #prints VANISH event_type = event.getType() print event_type #prints nothing. if event.type == ObserveEvent.VANISH print #prints nothing 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 #269110]: [1.1.0] observe: Handler Type test
Question #269110 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269110 Tetsuo gave more information on the question: Im using 1.10 btw. 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 #269110]: [1.1.0] observe: Handler Type test
Question #269110 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/269110 Status: Answered => Solved Tetsuo confirmed that the question is solved: Thanks RaiMan. Ill keep an eye on the nightly build page and will use your solution for now. -- 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
[Sikuli-driver] [Question #269337]: Offline setup
New question #269337 on Sikuli: https://answers.launchpad.net/sikuli/+question/269337 I think offline setup is not working. The reason (i think) is that the setup is aways trying to download selenium4sikulix.jar and not asking if we want to use the existing file. I could be wrong tough. I have download every single offline file and setup aways tries to download something and gives me an error in the end. I tried putting selenium4sikulix.jar in the sikulidata folder but it didnt work. 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 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 Status: Answered => Open Tetsuo is still having a problem: My bad. myRegion.setInactive(appear_handler) is not working too, even when not using popup. I will take a look closely at the docs. 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 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: 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