thenewkid Posted April 23, 2007 Share Posted April 23, 2007 how can i do i timer in autoit? so it would count down for 60 sec if you know what i mean? thx some of my scripts check them out and give feedback so i can learn from them :)autoclicker a autoclickernote taker a script to take notes with Link to comment Share on other sites More sharing options...
Wolffe Posted April 23, 2007 Share Posted April 23, 2007 It is usually easiest to search the forum first. I would suggest checking this thread.http://www.autoitscript.com/forum/index.php?showtopic=44117 Link to comment Share on other sites More sharing options...
SpookMeister Posted April 23, 2007 Share Posted April 23, 2007 If you are just looking for the nuts and bolts of how to work with a timer, check out TimerInit() in the help file [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
thenewkid Posted April 23, 2007 Author Share Posted April 23, 2007 i try this but it pauses my whole script and i cant use it intill it finshs $start = TimerInit() Sleep(30000) $stop = TimerDiff($start) some of my scripts check them out and give feedback so i can learn from them :)autoclicker a autoclickernote taker a script to take notes with Link to comment Share on other sites More sharing options...
SpookMeister Posted April 23, 2007 Share Posted April 23, 2007 Yup, thats what the Sleep function does. Sleep is used in the example just to create a passage of time so that the TimerDiff shows something. What you probably want to do is to periodically check if the value of TimerDiff($start) is greater than the value of time that you need. [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
thenewkid Posted April 23, 2007 Author Share Posted April 23, 2007 how would i do that? some of my scripts check them out and give feedback so i can learn from them :)autoclicker a autoclickernote taker a script to take notes with Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 23, 2007 Share Posted April 23, 2007 ; Demo timer $Time = TimerInit() MsgBox(32, "Demo Timer", "Hit OK when you feel like it...") $TimeDiff = TimerDiff($Time) / 1000 ; convert msec to sec $TimeDiff = Round($TimeDiff, 3) ; round to nearest msec MsgBox(64, "Demo Timer", "It took you " & $TimeDiff & " seconds to hit OK.") Read 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...
SpookMeister Posted April 23, 2007 Share Posted April 23, 2007 How are you intending to use it? Do you want some kind of clock to tick down in a GUI of some sort? Are you just wanting an invisible script to be doing something then stop after a certain amount of time has passed? $start = TimerInit() While 1 $time = TimerDiff($start) ; you could be doing whatever you want here ToolTip("Running: " & $time) Sleep(100) ; just put this in so we dont eat up the CPU If $time > 10000 Then Exit WEnd [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
Paulie Posted April 23, 2007 Share Posted April 23, 2007 how can i do i timer in autoit? so it would count down for 60 sec if you know what i mean? thxOr if you just want a countdown Timer. For $i = 60 to 0 step -1 ToolTip($i,0,0) Sleep(1000) Next Link to comment Share on other sites More sharing options...
thenewkid Posted April 23, 2007 Author Share Posted April 23, 2007 i would have the timer running but the gui has to be able to be used as well at the same time as the timer is running some of my scripts check them out and give feedback so i can learn from them :)autoclicker a autoclickernote taker a script to take notes with Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 23, 2007 Share Posted April 23, 2007 GUIRegisterMsg() and WM_TIMEROr AdLibEnable() a function that runs every few seconds to check on the timer. 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...
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