yucatan Posted January 25, 2011 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
jaberwacky Posted January 25, 2011 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: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
yucatan Posted January 25, 2011 Author 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/
wakillon Posted January 25, 2011 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.18.0 X86 - SciTE 5.5.7 - WIN 11 24H2 X64 - Other Examples Scripts
yucatan Posted January 25, 2011 Author Posted January 25, 2011 timer goes much to fast. it count down but not every second.
wakillon Posted January 25, 2011 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.18.0 X86 - SciTE 5.5.7 - WIN 11 24H2 X64 - Other Examples Scripts
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