0b3y Posted March 17, 2015 Share Posted March 17, 2015 (edited) This code is to do something while the PC hasn´t been used for x time. Example: If in 10 minutes the computer hasn´t been used it will start a process and mine bitcoin [HIDE-THANKS] [LENGUAJE=autoit] #include while 1 Sleep(1000) ;stop the execution 1 second $idle=_Timer_GetIdleTime() If $idle>500000 Then ;if the keyboard and the mouse haven´t been used in 5 minutes then do this ; STUFF TO DO Do Sleep(1000) ; loop until the computer is used again $idle2=_Timer_GetIdleTime() Until $idle2<$idle ;Thing to do when Pc is been used EndIf WEnd [/LENGUAJE] [/HIDE-THANKS] Edited March 17, 2015 by 0b3y Link to comment Share on other sites More sharing options...
Recommended Posts