AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A_TimeIdlePhysical reset by script despite installing hook

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Leon



Joined: 27 Aug 2007
Posts: 179

PostPosted: Thu Apr 24, 2008 6:26 pm    Post subject: A_TimeIdlePhysical reset by script despite installing hook Reply with quote

Hi,
I can't figure out why this isn't working.
Neither can jaco0646 - for whom it works.
I get the message "TimeIdlePhysical WAS reset by script" every time.
How can that be?

Code:
#InstallKeybdHook
#InstallMouseHook
q::
SetTimer, Check, -3000
Loop
{
Click down
Sleep, 500
}
return

Check:
If A_TimeIdlePhysical < 3000
MsgBox, TimeIdlePhysical WAS reset by script
Else
MsgBox, TimeIdlePhysical NOT reset by script
ExitApp
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Thu Apr 24, 2008 6:35 pm    Post subject: Reply with quote

how far off is it?

Code:

#InstallKeybdHook
#InstallMouseHook
q::
SetTimer, Check, -3000
Loop
{
Click down
Sleep, 500
}
return

Check:
If A_TimeIdlePhysical < 3000
MsgBox, TimeIdlePhysical WAS reset by script`n%A_TimeIdlePhysical%
Else
MsgBox, TimeIdlePhysical NOT reset by script`n%A_TimeIdlePhysical%
ExitApp


I think you are making a race condition between the A_TimeIdlePhysical and the SetTimer.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group