Re: [Sikuli-driver] [Question #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 Mike Praeuner confirmed that the question is solved: Thanks RaiMan, that solved my question. -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 Status: Answered => Solved Mike Praeuner confirmed that the question is solved: thank you - my knowledge now surpasses my skill - so I will go experiment and practice for a bit I "get" the function part, so I will start there, then work towards utilizing a for loop -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 RaiMan proposed the following answer: As far as I understand: def doSomething(gid, acc): setup app environment using gid and acc do something for an account tear down app environment you have 8 google-id with each having 1 - 5 accounts googleIDs = [g1, g2, g3, g4, g5, g6, g7, g8] accounts{g1:[a1, a2, a3, ...], g2:[a5, a6, ...], ...} for gid in googleIDs: for acc in accounts[gid]: doSomething(gid, acc) -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 Mike Praeuner posted a new comment: https://www.geeksforgeeks.org/functions-in-python/ -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 Mike Praeuner posted a new comment: ...or am I still thinking about this wrong (structure) and I should be "storing" the do stuff / action and "calling" it when needed? nOOb - thanks! -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 Mike Praeuner posted a new comment: clarification / correction this: Select Account perform action on account do stuff to: Select next account (1-5 possible) Exit app inside Nox should be: Select Account perform action on account do stuff to: Select next account (1-5 possible) perform action on account Exit app inside Nox -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 Mike Praeuner posted a new comment: Thank You RaiMan - I appreciate your patience & response. I will make the suggested corrections for second question...to structure a loop? My normal sequence is Run Script (scheduled task) Load Nox Load app do stuff to: Select Google ID do stuff to: Select Account perform action on account do stuff to: Select next account (1-5 possible) Exit app inside Nox Clear app data (via shell script shortcut) Load app do stuff to: Select (next) Google ID (8 possible) repeat for all 25 accounts Exit Nox Exit Script So would this be a for loop with the "select portion" as a set of variables? (my terminology is probably wrong, hopefully you can understand what I am trying to ask) What I really want to accomplish is (end goal) create 4-5 scripts that "perform different action(s) on account" based on the initial building blocks of being able to load and switch accounts -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 RaiMan proposed the following answer: ... same goes for image searches instead of: click(whatEver) wait(5) better: click(whatEver) wait(forSomeImage, 5) # might continue after 1 second if image is there -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 Status: Open => Answered RaiMan proposed the following answer: at 1--- App.open("D:\\Program Files\\Nox\\bin\\Nox.exe") sleep(15) App.focus("NoxPlayer") reg = App.focusedWindow() or app = App("D:\\Program Files\\Nox\\bin\\Nox.exe") app.open(15) # does the focus as well reg = app.window(0) ... the docs are showing ;-) https://sikulix-2014.readthedocs.io/en/latest/appclass.html#the-application-class-app at 2--- your problem surely is, that you have too many waits in your code, that are absolute. example from above: App.open("D:\\Program Files\\Nox\\bin\\Nox.exe") sleep(15) App.focus("NoxPlayer") ... sleep(15) waits 15 seconds, no matter what really happens better: app = App("D:\\Program Files\\Nox\\bin\\Nox.exe") app.open(15) # does the focus as well reg = app.window(0) ... open waits MAX. 15 seconds for the app to open. script continues at the moment, the app is open (might be after 3 seconds) -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 Mike Praeuner gave more information on the question: I am currently reading up on Python Loops... https://www.geeksforgeeks.org/loops-in-python/ Just need to wrap my head around how to implement / structure -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 Description changed to: First question: I am using app.open (to launch Nox) then app.focus (to go to the "Nox Player" window) How do I set the region to the Nox window (only one window open)? #sample code App.open("D:\\Program Files\\Nox\\bin\\Nox.exe") sleep(15) App.focus("NoxPlayer") # Second question: I have my first sikuli script mostly working (it should take ~30m to run, currently ~1.5 hours, so it needs optimized) I load Nox, clear android app data, load the app, select the google ID, select the account (1 of 5 potential) then perform the desired action (my first test is just to open and close the app for all 8 Google IDs, 25 accounts -- 60s global app timer between accounts) Currently this script is 1600+ lines, with a large amount of repeat content (indicating my lack of coding skills) I am pretty certain I did this the hardest way possible, so where would I start to simplify and consolidate? Regretfully I am not near my personal computer, but I will gladly load any files (.skl?) for reference when I get home this evening Updated Source File: https://www.dropbox.com/s/9eahdut5szxhsh0/DailyLogon.skl?dl=0 -- 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 #680383]: hopefully (2) easy questions (region.focus & code consolidation)
Question #680383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680383 Description changed to: First question: I am using app.open (to launch Nox) then app.focus (to go to the "Nox Player" window) How do I set the region to the Nox window (only one window open)? Second question: I have my first sikuli script mostly working (it should take ~30m to run, currently ~1.5 hours, so it needs optimized) I load Nox, clear android app data, load the app, select the google ID, select the account (1 of 5 potential) then perform the desired action (my first test is just to open and close the app for all 8 Google IDs, 25 accounts -- 60s global app timer between accounts) Currently this script is 1600+ lines, with a large amount of repeat content (indicating my lack of coding skills) I am pretty certain I did this the hardest way possible, so where would I start to simplify and consolidate? Regretfully I am not near my personal computer, but I will gladly load any files (.skl?) for reference when I get home this evening -- 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
[Sikuli-driver] [Question #680383]: hopefully (2) easy questions (region.focus & code consolidation)
New question #680383 on Sikuli: https://answers.launchpad.net/sikuli/+question/680383 First question: I am using app.open (to launch Nox) then app.focus (to go to the "Nox Player" window) How do I set the region to the Nox window (only one window open)? Second question: I have my first sikuli script mostly working (it should take ~30m to run, currently ~1.5 hours, so it needs optimized) I load Nox, clear android app data, load the app, select the google ID, select the account (1 of 5 potential) then perform the desired action (my first test is just to open and close the app for all 8 Google IDs, 25 accounts -- 60s global app timer between accounts) Currently this script is 1600+ lines, with a large amount of repeat content (indicating my lack of coding skills) Regretfully I am not near my personal computer, but I will gladly load any files (.skl?) for reference when I get home this evening -- 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