| View previous topic :: View next topic |
| Author |
Message |
emerysteele
Joined: 30 Jul 2009 Posts: 10
|
Posted: Sun Nov 15, 2009 11:42 pm Post subject: Mouse/Keyboard inactive for |
|
|
| 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. |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 722 Location: Iowa, USA
|
|
| Back to top |
|
 |
emerysteele
Joined: 30 Jul 2009 Posts: 10
|
Posted: Mon Nov 16, 2009 5:48 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|