PcExpert Posted December 22, 2007 Posted December 22, 2007 Hi all, How to detect if PC is idle, so the user is away from the computer and then shut it down after 45 minutes? Thanks!
Xenobiologist Posted December 22, 2007 Posted December 22, 2007 Hi, how do you do it manually? What is your criteria? So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
Jex Posted December 22, 2007 Posted December 22, 2007 (edited) You can check mouse move. If mouse not move 45 minute then close pc. $Idle = 0 $Old = MouseGetPos() While 1 $Get = MouseGetPos() If $Get[0] = $Old[0] And $Get[1] = $Old[1] Then $Idle += 1 Else $Idle = 0 EndIf If $Idle <> 0 Then TrayTip("", "Idle time : " & $Idle & " second.", 1, 16) Else TrayTip("", "", 0) EndIf $Old = MouseGetPos() Sleep(1000) WEndoÝ÷ Ù:ÚÉ8©~ì!£¬Âäx-«lr¸©µ.çi×eG«m)àjëh×6$Minute = 45 If $Idle >= (60 * $Minute) Then Shutdown(1) Edited December 22, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer
ptrex Posted December 22, 2007 Posted December 22, 2007 @All Maybe this can help Func _CheckIdle(ByRef $last_active, $start = 0) $struct = DllStructCreate("uint;dword"); DllStructSetData($struct, 1, DllStructGetSize($struct)); If $start Then DllCall("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr($struct)) $last_active = DllStructGetData($struct, 2) Return $last_active Else DllCall("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr($struct)) If $last_active <> DllStructGetData($struct, 2) Then Local $save = $last_active $last_active = DllStructGetData($struct, 2) Return $last_active - $save EndIf EndIf EndFunc ;==>_CheckIdle regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
weaponx Posted December 22, 2007 Posted December 22, 2007 Just as in this topic:http://www.autoitscript.com/forum/index.ph...;hl=screensaverI would create a screensaver in AutoIt that just had a command to shutdown.http://www.autoitscript.com/forum/index.ph...;hl=screensaverActually I think if you rename your compiled script to *.scr it will run if you choose it in your screensaver list.
Nevin Posted December 22, 2007 Posted December 22, 2007 Interesting. It would be fun to take my father's screensaver (Windows Logo that moves around) and after a while just make some crazy shit happen to it... He'd probably not even notice, though.
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