hutralospi Posted October 6, 2018 Share Posted October 6, 2018 For the purpose of taking consecutive 3 screenshots at specific intervals of time, I wrote this script: =============== #include <Constants.au3> #include <MsgBoxConstants.au3> HotKeySet("^g", "Take3Screenshots") ; Ctrl+g HotKeySet("^+g", "RegularIntervalsSS") ; Ctrl+Shift+g While 1 Sleep(100) WEnd Func Take3Screenshots() Sleep(500) Send("^+s") Sleep(500) Send("^+s") Sleep(500) Send("^+s") Sleep(500) EndFunc ;==>Take3Screenshots Func RegularIntervalsSS() While 1 Send("^g") Sleep(60000) ;60 seconds =1 minute WEnd EndFunc ;==>RegularIntervalsSS =============== When I execute the above script, the screenshots taken are at the times: 034931, 034932, 034933, 035035, 035036, 035037, 035138, 035139, 035140 As can be seen, the time for the screenshot at the next minute is automatically incremented. ie., instead of the screenshots being taken at 035031 and 035131, they are taken at 035035 and 035138. As I need to take continual screenshots, these time differences increment every minute which doesn't hence serve the purpose of taking consecutive 3 screenshots at specific intervals of time. How can this be solved? Any help is welcome. Thanks in advance. Link to comment Share on other sites More sharing options...
hutralospi Posted October 6, 2018 Author Share Posted October 6, 2018 By the way, Ctrl+Shift+S is the (customizable) shortcut key for taking screenshot in a screen-capture program I use. Link to comment Share on other sites More sharing options...
caramen Posted October 6, 2018 Share Posted October 6, 2018 (edited) I guess i got your problem. You have to change your options. I explain you, If you are in any software. If a key is used to do somthing. You have to let this key free in your script. I always had problem doing this. when i had that problem it is ofen becose i attach hotkey before testing them. Let's make is easy: If you are in a software using A B C as shordcut key. If autoIT use A B C It wont play your function but it will do software action or both or conflict. Becose they aren't free. To make this work you have to make autoIT use D E F to send the command A B C but not as a duplicated shordcut. This could work better. #include <Constants.au3> #include <MsgBoxConstants.au3> HotKeySet("A", "Take3Screenshots") ; Ctrl+g But now Ctrl+g is free in your script. HotKeySet("B", "RegularIntervalsSS") ; Ctrl+Shift+g But now Ctrl+Shift+g is free in your script. While 1 Sleep(100) WEnd Func Take3Screenshots() Sleep(500) Send("^+s") Sleep(500) Send("^+s") Sleep(500) Send("^+s") Sleep(500) EndFunc ;==>Take3Screenshots Func RegularIntervalsSS() While 1 Send("^g") Sleep(60000) ;60 seconds =1 minute WEnd EndFunc ;==>RegularIntervalsSS Let me know. And i whould change this: While 1 Send("^g") Sleep(60000) ;60 seconds =1 minute WEnd By this (But in this case rethink the script a bit ;p ): AdlibRegister ("MyScreen", 60000 ) While 1 Sleep(10) WEnd Func MyScreen () Send("^g") EndFunc And even improve HotKeySet("C", "UnregisterMyScreen") Func UnregisterMyScreen () AdlibUnRegister ("MyScreen") EndFunc Edited October 6, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted October 6, 2018 Share Posted October 6, 2018 @hutralospi @caramen _ScreenCapture_Capture should do the trick too Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted October 6, 2018 Share Posted October 6, 2018 1 minute ago, FrancescoDiMuro said: @hutralospi @caramen _ScreenCapture_Capture should do the trick too But the udf wont implement screens inside the software bro ? Personally i use screencapture too My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted October 6, 2018 Share Posted October 6, 2018 2 hours ago, caramen said: But the udf wont implement screens inside the software bro ? Are you talking about take a screen of a window instead of all the screen or... ? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted October 6, 2018 Share Posted October 6, 2018 Just noticing you he is using a software to take screens and not an udf so... may he got some code with that already. But who knwo; My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
hutralospi Posted October 6, 2018 Author Share Posted October 6, 2018 @ caramen Thanks a LOT for taking efforts to explain the details. @ FrancescoDiMuro Thanks for the suggestion. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now