timmy2 Posted November 28, 2018 Share Posted November 28, 2018 (edited) Every script, post and Help file entry that I have read defines "idle" as no mouse or keyboard activity. Quote _Timer_GetIdleTime Returns the number of ticks since last user activity (i.e. KYBD/Mouse) "i.e" means "for example", which a lawyer would say means "includes but is not limited to". Leaving that thought dangling... This article, "The Definition of Windows Idle," says: Quote The computer is considered to be idle by Windows if there has not been user interaction via the mouse or keyboard for a given time and if the hard drives and processors have been idle more than 90% of that time. (Windows 7 considers the PC to be idle if these states return true for a period of 10 minutes.) How do you reconcile the two? If we're referring to the same measurement of "idle" it would mean that Task Scheduler's "on idle" will trigger after 600,000 ticks as measured by _Timer_GetIdleTime, correct? Edited November 28, 2018 by timmy2 clarification Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 28, 2018 Moderators Share Posted November 28, 2018 You posted this in GH & S, do you have a script-specific question, or is this more of a philosophical question destined for the appropriate sub forum? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
BrewManNH Posted November 29, 2018 Share Posted November 29, 2018 AutoIt uses the GetLastInputInfo function to determine idle time in that function. It's got nothing to do with how Windows determines idle time, so that link doesn't apply here. timmy2 1 If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
timmy2 Posted November 30, 2018 Author Share Posted November 30, 2018 15 hours ago, BrewManNH said: AutoIt uses the GetLastInputInfo function to determine idle time in that function. It's got nothing to do with how Windows determines idle time, so that link doesn't apply here. Thank you for answering, @BrewManNH! So it sounds like "idle" here really means "user idle". Can AutoIt access Windows' idle function, thereby taking into account hardware activity, too? Link to comment Share on other sites More sharing options...
BrewManNH Posted December 1, 2018 Share Posted December 1, 2018 On 11/30/2018 at 9:06 AM, timmy2 said: Can AutoIt access Windows' idle function, thereby taking into account hardware activity, too? Yes, but why would you want to? Most of the documentation I've read for idle time is for the task scheduler, so if you're not using it as a scheduled task, user interaction would be the best indication of "idleness". If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
timmy2 Posted December 1, 2018 Author Share Posted December 1, 2018 4 hours ago, BrewManNH said: Yes, but why would you want to? Most of the documentation I've read for idle time is for the task scheduler, so if you're not using it as a scheduled task, user interaction would be the best indication of "idleness". Sometimes I overlook the obvious, so I might be doing that here, but what if the user is watching a YouTube video? Come to think of it, I suppose I could deal with situations like that by displaying a prompt with a timeout. If the user doesn't respond I can proceed with my housekeeping and logging out the session. Hmm, but what if the user is rendering something in a CGI program or some other CPU-/HDD-intensive process, and the user isn't present? I think that's what prompted me to ask about the AutoIt definition of "idle". I don't recall at the moment why I didn't want to just use Task Scheduler, and maybe have it spawn an AutoIt script. Nonetheless, isn't it worth noting the different "idle" meanings? Link to comment Share on other sites More sharing options...
BrewManNH Posted December 2, 2018 Share Posted December 2, 2018 You're looking for something along the lines of, for example, disabling the screensaver. Which means telling the OS that the computer is being used, even if no one is interacting with it. For that you'd probably need to set the ThreadExecutionState with the ES_DISPLAY_REQUIRED/ES_CONTINUOUS parameter setting. I believe there was a recent thread on this here. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
timmy2 Posted December 2, 2018 Author Share Posted December 2, 2018 25 minutes ago, BrewManNH said: You're looking for something along the lines of, for example, disabling the screensaver. Which means telling the OS that the computer is being used, even if no one is interacting with it. For that you'd probably need to set the ThreadExecutionState with the ES_DISPLAY_REQUIRED/ES_CONTINUOUS parameter setting. I believe there was a recent thread on this here. I apologize for being unclear, but thank you for replying, @BrewManNH. I want to run an AutoIt script that will do some housekeeping and then log out the user. But I don't want to do that -- especially logging him out -- if he's still "using" the computer. Microsoft's version of "idle" is more complete since it takes into account user activity as well as CPU and HDD activity. I was wondering if AutoIt was tapping into the same Idle, but it turns out it's using a different source that solely user activity. Link to comment Share on other sites More sharing options...
Davidowicza Posted December 3, 2018 Share Posted December 3, 2018 It's probably not what you are looking since a lot of people I find do not like using Task Scheduler but, if you want to run a cleanup and log off the user when Windows goes "idle", you can make an AutoIT script that Task Scheduler starts when the computer goes "idle". 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