yucatan Posted January 25, 2011 Share Posted January 25, 2011 Hello guys i'm using this script to count from 10 to zero. i wanne make it like this that if it reaches 10 that the counter restart. but i dont know how i need to do that. some help Pleas? Thanks alot. $count_down_time = 1 ;sec $corected_time = $count_down_time * 1000 $timer = TimerInit() Global $display_old while 1 $display = Floor(($corected_time-TimerDiff($timer))/1000) if $display <> $display_old Then ConsoleWrite($display&@CRLF) $display_old = $display EndIf ;~ == end of display countdown part === if TimerDiff($timer)>= $corected_time Then exit EndIf WEnd Link to comment Share on other sites More sharing options...
jaberwacky Posted January 25, 2011 Share Posted January 25, 2011 (edited) Something like this? $count_down_time = 1 ;sec $corected_time = $count_down_time * 1000 $timer = TimerInit() Global $display_old Global $counter = 0 While 1 $counter += 1 $display = Floor(($corected_time - TimerDiff($timer)) / 1000) If $display <> $display_old Then ConsoleWrite($display & @CRLF) $display_old = $display EndIf ;~ == end of display countdown part === If TimerDiff($timer) >= $corected_time Then Exit EndIf If $counter = 10 Then $COunter = 0 EndIf WEnd Edit* DOH! I forgot to count down from ten. Edited January 25, 2011 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
yucatan Posted January 25, 2011 Author Share Posted January 25, 2011 script is the same.... it needs to count down from 5 to 0 if it has reaches 0 then start again from 5 to 0/ Link to comment Share on other sites More sharing options...
wakillon Posted January 25, 2011 Share Posted January 25, 2011 (edited) script is the same.... it needs to count down from 5 to 0 if it has reaches 0 then start again from 5 to 0/ Like this ? $timer = TimerInit() Global $display_old=1 while 1 $display = Floor ( TimerDiff ( $timer ) ) If $display <> $display_old Then ConsoleWrite(5-$display&@CRLF) $display_old = $display EndIf ;~ == end of display countdown part === If TimerDiff($timer)> 5 Then $timer = TimerInit() EndIf WEnd Edited January 25, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
yucatan Posted January 25, 2011 Author Share Posted January 25, 2011 timer goes much to fast. it count down but not every second. Link to comment Share on other sites More sharing options...
wakillon Posted January 25, 2011 Share Posted January 25, 2011 (edited) timer goes much to fast. it count down but not every second. Sorry it was milliseconds, now it's seconds ! $timer = TimerInit() Global $display_old=1 while 1 $display = Floor ( TimerDiff ( $timer )/1000 ) If $display <> $display_old Then ConsoleWrite(5-$display&@CRLF) $display_old = $display EndIf If TimerDiff($timer)/1000 > 5 Then $timer = TimerInit() WEnd Edited January 25, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
yucatan Posted January 25, 2011 Author Share Posted January 25, 2011 thanks 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