Project

General

Profile

Prevent system sleep and hibernation or turning off monitor

Added by Mr. BS about 9 years ago

The script bellow start a persistent timer on startup to check if system is idle for at least 5 minutes, if true, then send a keystroke to toggle Num lock key. This makes system idle time to reset preventing system sleeping, hibernating or turning off monitor.

Optimize the timer for your needs.

Code

on *:Start: .timerPREVENTSLEEP 0 300 if ($!osidle >= 300) sendkey {NUMLOCK}{NUMLOCK}

alias -l sendkey {
  var %name sk $+ $ticks
  .comopen %name WScript.Shell
  .comclose %name $com(%name,SendKeys,3,bstr,$1-)
}

Ps: requires AdiIRC 1.9.7+

More info: $osidle.