DaProgrammer Posted August 9, 2007 Share Posted August 9, 2007 If u need to have a 20 second minute or a 10 hour day than u can use this: just set up your "$Max" Values u need and enjoy imbedding it to your apps. expandcollapse popup$MaxSeconds = 3 $MaxMinutes = 5 $MaxHours = 3 $Seconds = 0 $Minutes = 0 $Hours = 0 $days = 0 GuiCreate("Manual Clock", 100, 50) $Label = GuiCtrlCreateLabel($days & " : " & $Hours & " : " & $Minutes & " : " & $Seconds, 10, 10, 80, 30,0x01) GuiSetState() While 1 W8forSec() $Seconds = $Seconds + 1 If $Seconds = $MaxSeconds Then $Minutes = $Minutes +1 $Seconds = 0 If $Minutes = $MaxMinutes Then $Hours = $Hours + 1 $Minutes = 0 If $Hours = $MaxHours Then $days = $days + 1 $Hours = 0 If $Hours = $MaxHours Then $days = $days + 1 $Hours = 0 EndIf EndIf EndIf EndIf GUICtrlSetData($Label,$days & " : " & $Hours & " : " & $Minutes & " : " & $Seconds) WEnd Func W8forSec() $Time = @SEC While @SEC = $Time Sleep(50) WEnd EndFunc Link to comment Share on other sites More sharing options...
jvanegmond Posted August 9, 2007 Share Posted August 9, 2007 Radical, and it actually works pretty good. github.com/jvanegmond Link to comment Share on other sites More sharing options...
RazerM Posted August 10, 2007 Share Posted August 10, 2007 Well if i ever need a 20 second minute or a 10 hour day I'll know where to come... Might want to make the gui on event mode for exiting. My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
DaProgrammer Posted August 11, 2007 Author Share Posted August 11, 2007 Might want to make the gui on event mode for exiting.didn't try to make it usefull just cut the code(without the gui) and inplement in your program Link to comment Share on other sites More sharing options...
DaProgrammer Posted August 11, 2007 Author Share Posted August 11, 2007 $MaxSeconds = 3 $MaxMinutes = 3 $MaxHours = 3 $Seconds = 0 $Minutes = 0 $Hours = 0 $days = 0 GuiCreate("Manual Clock", 100, 50) $Label = GuiCtrlCreateLabel($days & " : " & $Hours & " : " & $Minutes & " : " & $Seconds, 10, 10, 80, 30,0x01) GuiSetState() $Time = TimerInit() While 1 $Seconds = Int(TimerDiff($Time)/1000) - $Minutes*$MaxSeconds - $Hours*$MaxMinutes*$MaxSeconds - $days*$MaxHours*$MaxMinutes*$MaxSeconds If $Seconds = $MaxSeconds Then $Minutes = $Minutes +1 $Seconds = $Seconds - $MaxSeconds If $Minutes = $MaxMinutes Then $Hours = $Hours + 1 $Minutes = $Minutes - $MaxMinutes If $Hours = $MaxHours Then $days = $days + 1 $Hours = $Hours - $MaxHours EndIf EndIf EndIf GUICtrlSetData($Label,$days & " : " & $Hours & " : " & $Minutes & " : " & $Seconds) Sleep(250) WEnd same idea only based on timer instead of PC-Clock choose whatever works best for you 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