Jump to content

scriptme

Members
  • Posts

    5
  • Joined

  • Last visited

scriptme's Achievements

  1. Thank you, thank you, thank you BrewMan. That's is exactly what I'm looking for. Thank you markyrocks as well. You guys are awesome. Happy Holidays!
  2. Thank you markyrocks! That is definitely close to what I'm looking for! BrewManNH, I'm looking to display in the console as it's idle the hours/minutes/seconds.
  3. I would like to use _TicksToTime in Date.au3 so I can get idle time in Hours/Minutes/Seconds unless that's possible with _Timer_GetIdleTime. I just can't seem to figure out how to get a realtime output from the above script. Is there a way to do that?
  4. I was hoping to have it output straight to the console. Is that possible?
  5. Hi all. This is my first time posting. I have trying to figure out how to create a script that will determine if a user has been idle. I have a script that I found on autoscript.com but would like this script to output the results in real time in hours/minutes/seconds. This script only outputs the idle time after a key has been pressed: Any help would be appreciated: ; User/System Idle Time #include <Date.au3> HotKeySet("{Esc}", "_Terminate") Local $last_active = 0, $iHours, $iMins, $iSecs Local $not_idle = _CheckIdle($last_active, 1) while (1) Sleep(200) $not_idle = _CheckIdle($last_active) _TicksToTime($not_idle, $iHours, $iMins, $iSecs) If $iHours or $iMins Or $iSecs Then ConsoleWrite("Was Idle for: Hours: " & $iHours & " Minutes: " & $iMins & " Seconds: " & $iSecs & @LF) EndIf WEnd Func _CheckIdle(ByRef $last_active, $start = 0) Local $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() Func _Terminate() Exit EndFunc ;==>_Terminate
×
×
  • Create New...