RogerRabbitsClone Posted December 28, 2009 Share Posted December 28, 2009 situation: i want the script to stop running when i am active, and start when i am not. problem: i found help with making it start when i am not active. but not to stop when i am. my script: AdLibEnable("_UpdateTimer", 100) Global $nTimer = 0 Global $OldMousePosition = MouseGetPos() GLobal $NewMousePosition While(1) sleep(10) WEnd Func _UpdateTimer() $nTimer += 100 ;100 ms $NewMousePosition = MouseGetPos() if (($NewMousePosition[0] == $OldMousePosition[0]) and ($NewMousePosition[1] == $OldMousePosition[1])) Then ; The user is still idle (you might also want to check for key presses Else ; The user moved, we should start the timer over. $OldMousePosition = $NewMousePosition $nTimer = 0 EndIf if ($nTimer >= 5000) Then ;Change the '5000' to the number in milliseconds you want to wait, with your user being idle. _OnTimerFinish() $nTimer = 0 EndIf EndFunc Func _OnTimerFinish() run ("photoshoppiceditV4.exe") EndFunc <--a good way to start you day Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 28, 2009 Share Posted December 28, 2009 Use _Timer_GetIdleTime() to check user idle time (see help file). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
RogerRabbitsClone Posted December 28, 2009 Author Share Posted December 28, 2009 thank you thank you. <--a good way to start you day 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