adik2dmax666 Posted April 13, 2010 Share Posted April 13, 2010 (edited) Is there a script that will check if the mouse has not been clicked for a while and the keyboard was not pressed. If mouse is not clicked and the keyboard has not been pressed for 1 hour then force shutdown pc. Im very annoyed because my brother always leaves the pc open when he sleeps and our electric bills has skyrocketed because of that. I've search for scripts that will execute some task after the timer has done its loop Global Const $Minutes = 30 Global $60Count = 0, $begin = TimerInit() While $Minutes > $60Count ;check if mouse and keyboard are idle sleep(1) $dif = TimerDiff($begin) $Count = int($dif/1000) $60Count = Int($Count / 60) WEnd call("_forceshutdown") Func _forceshutdown() Shutdown(5) ;Force a shutdown MsgBox(0, "Automatic program", "!! Shutting down !!",15) EndFunc Edited April 13, 2010 by adik2dmax666 First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack. -George Carrette[sub]GD Keylogger Creator (never released)[/sub][sub]Garena Autojoin v3.0[/sub] Link to comment Share on other sites More sharing options...
doudou Posted April 13, 2010 Share Posted April 13, 2010 (edited) Is there a script that will check if the mouse has not been clicked for a while and the keyboard was not pressed. If mouse is not clicked and the keyboard has not been pressed for 1 hour then force shutdown pc. Im very annoyed because my brother always leaves the pc open when he sleeps and our electric bills has skyrocketed because of that.I've search for scripts that will execute some task after the timer has done its loopControlling automatic PC shutdown via script that polls for user input is very inefficient and unreliable. All Windows versions from Win95 on provide built-in mechanisms to achieve what you need: go to Control Panel -> Energy Options and configure there the timeouts to trigger stand-by or hibernate (soft-off). Further options (log-off, shutdown) offers a screensaver Winexit freely available from Microsoft. Edited April 13, 2010 by doudou UDFS & Apps: Spoiler DDEML.au3 - DDE Client + ServerLocalization.au3 - localize your scriptsTLI.au3 - type information on COM objects (TLBINF emulation)TLBAutoEnum.au3 - auto-import of COM constants (enums)AU3Automation - export AU3 scripts via COM interfacesTypeLibInspector - OleView was yesterday Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEĀ Link to comment Share on other sites More sharing options...
omikron48 Posted April 13, 2010 Share Posted April 13, 2010 Yup. Control Panel -> Power Options is the way. Just set a hibernate idle time. If power bills are your issue, you can also set a monitor power off on idle too. 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