Mattraks Posted April 3, 2008 Share Posted April 3, 2008 (edited) Delete Edited October 21, 2008 by Mattraks Link to comment Share on other sites More sharing options...
Swift Posted April 3, 2008 Share Posted April 3, 2008 I think the TimerInit() is what you want, because it will increase every second, and you can set a variable checking if it 1 sec. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 3, 2008 Share Posted April 3, 2008 Ok, i have a button and i want to make a timer and after 1 second increase a variable. The question is how do i make a timer and tell if it has been 1 second or not?You could just do Sleep(1000) if you don't need the rest of the script to be responsive during that time.Otherwise, initialize a variable with TimerInit() and check it with TimerDiff(). The difference is given in milliseconds. See the examples in the 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...
MDCT Posted April 3, 2008 Share Posted April 3, 2008 Maybe: $Time = TimerInit() While 1 $Diff=TimerDiff($Time) If $Diff >= 1000 then ToolTip("1 sec") Sleep(5) WEnd Or maybe: $Diff=0 $Time = TimerInit() While $Diff < 1000 $Diff=TimerDiff($Time) Sleep(5) WEnd Tooltip("test") Sleep(1500) But sleep(1000) is much better if you need to sleep for 1 sec. Link to comment Share on other sites More sharing options...
GaryFrost Posted April 4, 2008 Share Posted April 4, 2008 Or you could use a _Timer_SetTimer with a 1000 ms (1 second) elapse and wouldn't need to check if a second has elapsed in the loop SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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