Doxie Posted March 5, 2008 Posted March 5, 2008 (edited) Hi, Is it hard/possible to make a clock that got 4 days within 24 hours? If i got a clock that need to go 4x the speed as a normal clock, and also the ability to convert normal time to the faster time. For example: Day: 0 - Time: 00:00 = 5th March - 15:00 (realtime) Day: 0 - Time: 04:00 = 5th March - 16:00 Day: 1 - Time: 00:00 = 5th March - 21:00 etc So if i enter Day: 5 Time: 16:00 the program would tell me what realtime that is. And also if i enter realtime it would convert to faster time. Would appriciate if you could give me some advice how to do this. Thanks in advance Edited March 5, 2008 by Doxie Were ever i lay my script is my home...
Monamo Posted March 5, 2008 Posted March 5, 2008 Hi,Is it hard/possible to make a clock that got 4 days within 24 hours?If i got a clock that need to go 4x the speed as a normal clock, and also the ability to convert normal time to the faster time.For example:Day: 0 - Time: 00:00 = 5th March - 15:00 (realtime)Day: 0 - Time: 04:00 = 5th March - 16:00Day: 1 - Time: 00:00 = 5th March - 21:00etcSo if i enter Day: 5 Time: 16:00 the program would tell me what realtime that is.And also if i enter realtime it would convert to faster time.Would appriciate if you could give me some advice how to do this.Thanks in advanceWell, the basic underlying factor is the 4x speed. What I'd do is take my base time (real time, whatever) and break it down into seconds, then multiply the seconds by 4 to track the total number of "Fast seconds" that would have progressed. Then I'd just parse the "Fast seconds" down to determine the "Fast time" reading.Here's a simple bit to demonstrate the conversion(s). Hopefully it's of some use to you in getting started (example results are written to the console):CODEConst $sec = 1Const $min = 60Const $hour = 60Const $day = 24Const $SecondsPerDay = $sec * $min * $hour * $day$startSec = "00"$startMin = "00"$startHour = "00"$startDay = "00";~ $baseSec = @SEC;~ $baseMin = @MIN;~ $baseHour = @HOUR$baseSec = 00$baseMin = 00$baseHour = 06$fastSec = $baseSec$fastSec += $baseMin * $min * $sec$fastSec += $baseHour * $hour * $min * $sec$fastSec *= 4_TimeCleanup($fastSec)Func _TimeCleanup($iSec) $iMin = 0 $iHour = 0 $iDay = 0 If $iSec >= $min Then Do $iSec -= $min $iMin += 1 Until $iSec < $min If StringLen($iSec) =1 Then $iSec = "0" &$iSec EndIf If $iMin >= $hour Then Do $iMin -= $hour $iHour += 1 Until $iMin < $hour If StringLen($iMin) =1 Then $iMin = "0" &$iMin EndIf If $iHour >= $day Then Do $iHour -= $day $iDay += 1 Until $iHour < $day If StringLen($iHour) =1 Then $iHour = "0" &$iHour EndIf If StringLen($iDay) =1 Then $iDay = "0" &$iDay ConsoleWrite("Day: " & $iDay & @CRLF) ConsoleWrite("Hour: " & $iHour & @CRLF) ConsoleWrite("Minute: " & $iMin & @CRLF) ConsoleWrite("Second: " & $iSec & @CRLF)EndFunc ;==>_TimeCleanup - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]
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