Re: [Sikuli-driver] [Question #229825]: do an action if the image on a region doesn't change
Question #229825 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/229825 Mark Weisler posted a new comment: The following working code might help you... # script: RegionAreaTest6, 01 June 2013 # Related to [Question #229825]: do an action if the image on a region doesn't change # This Sikuli script monitors a screen area to detect change. bigChange=False # a global variable set if a region changes def changed(event): # this function runs if change is observed print something changed in , event.region global bigChange # set to true if this function runs bigChange=True print bigChange for ch in event.changes: ch.highlight(2) # highlight all changes sleep(1) for ch in event.changes: ch.highlight() # turn off the highlights event.region.stopObserver() # now start watching a Chicago Transit Authority map of buses moving down streets # http://ctabustracker.com/bustime/map/displaymap.jsp print Starting... myRegion=Region(200,250,500,500) # adjust size of region examined, make area as small as reasonably possible to limit searching, analysis #myRegion=Region(420,270,200,200) # an alternative region that is smaller myRegion.highlight(3) # for illustrative purposes, not functionally necessary wait(1) myRegion.highlight(0) #remove highlight wait(1) print bigChange # value of the variable before starting the monitoring myRegion.onChange(30, changed) # install 'changed' as the function to run if changes are discovered myRegion.observe(30,background=True) # start observing for 30 seconds before proceeding # Monitoring is now running. # Next start a loop to check for changes in the monitored area... myLimit=4 i = 0 # index for our loop mycontinue = True print Starting mycontinue loop... while mycontinue: print bigChange if bigChange: print Something just changed. else: print No change yet. # Do some desired action here... i +=1 # increment index if i =myLimit: mycontinue=False wait(5) print Leaving mycontinue loop... myRegion.stopObserver() #stops the observer myRegion=Region(100,300,500,500) myRegion.highlight(3) wait(1) print bigChange exit(0) -- 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 #229825]: do an action if the image on a region doesn't change
Question #229825 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/229825 Status: Open = Solved Greg83140 confirmed that the question is solved: Thank you, I tested your code it works well ! Have a nice sunday -- 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 #230046]: How to write command for Alt + Space +x to expand window
Question #230046 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/230046 Status: Answered = Solved Eric Yu confirmed that the question is solved: Hi, Robert Thanks for your answer. I tried it but it didn't work. But, your answer enlightened me. I found the menu shown on browser is the result of command Alt + Space and was waiting for user to input x. So, I updated the command like below: +++ type(Key.SPACE, KeyModifier.ALT) type('x') ++ In this way, it works very well. Thanks, Eric -- 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 #230048]: Unable to type none-English text
Question #230048 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/230048 Status: Answered = Solved Eric Yu confirmed that the question is solved: Hi, Roman Thanks so much for your help. My problem get resolved by it. Thanks, Eric -- 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 #230048]: Unable to type none-English text
Question #230048 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/230048 Eric Yu confirmed that the question is solved: Thanks Roman Podolyan, 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