AutoHotkey Community

It is currently May 26th, 2012, 11:17 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: November 16th, 2009, 12:42 am 
Offline

Joined: July 30th, 2009, 4:15 am
Posts: 36
I want a script that will tell if the keyboard/mouse has been inactive for 10 minutes and then shut the monitor off with 'Run "C:\Windows\nircmd.exe" monitor off'. The reason i want to do this instead of using the built in feature of windows, is because I want to set it up so it will detect if youtube is open, and if it is, then the monitor won't go off.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 16th, 2009, 2:03 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
Check out the built-in variable A_TimeIdlePhysical

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 16th, 2009, 6:48 am 
Offline

Joined: July 30th, 2009, 4:15 am
Posts: 36
Perfect. I used the following code to achieve what I want.

Code:
#Persistent
SetTimer, CheckIdle, 60000 ; Check every 1 minute
return

CheckIdle:
if A_TimeIdle >= 600000 ; after 10 minutes idle time
{
  IfWinExist, YouTube
  {
   
  }
  else
  {
    Run "C:\Windows\nircmd.exe" monitor off ; Puts monitor into standby mode
  }
}
return


You must have nircmd for this to work.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Cerberus, Google Feedfetcher, Maestr0, rbrtryn, Tipsy3000 and 65 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group