But in my country we go by the 12-hour clock
your country is silly, use a 24h clock.
But in my country we go by the 12-hour clock
Thank you, this is very helpful. Which would you prefer? The loop or the other one you mentioned where it deletes and redisplays the correct time?[DOUBLEPOST=1364782018][/DOUBLEPOST]Mine was a bit different.
Code:i = 1 while i == 1 do term.clear() term.setCursorPos(1,1) print(textutils.formatTime(os.time(), boolean)) sleep(1) end
The term.clear and term.setSursorPos just clear the screen and resets the cursor so it always puts the time on the top line.
The sleep is just so that there is a delay between time refreshes, no point having it refresh every tick.
The while i == 1 do
"code"
end
Is just an infinite Do loop. I set the variable i to be 1 at the start, so it is always true and so always loops. You could replace the first 2 lines with 'while true do' and it should still work.
I agree with you. In fact, my phone uses the 24 clock. Alas, if I made a 24 clock in the game, my friend would complain about it hahayour country is silly, use a 24h clock.
Thank you, this is very helpful. Which would you prefer? The loop or the other one you mentioned where it deletes and redisplays the correct time?
Well how long is each 'tick'? And how about a Minecraft minute? I'd like the clock to display the correct time every minute.They are both loops, but with the first loop that was suggested the time would just keep filling up the screen and you would get a long list of times and eventually crash the computer (trust me, I tried), so I just improved it by deleting the previous time, resetting the cursor (otherwise the time would just keep going down the screen) and then printing the new time, so it looks like it is updating.
So, I would say it is worth adding in the couple of lines to allow it to clear and then re print the clock as it would look neater. I only put the sleep(1) command in because I'm sure you don't want it to update every tick, so it updates every second instead, just change the number in the brackets to adjust the length of time between refreshes, so sleep(2) refreshes every 2 seconds, sleep(0.5) is every half a second etc.
That's just silly. Your country should use a binary clock. That's what we did, but because the Prime Minister had a fear of the number one, we had to adjust all the clocks to make it from just zeros.your country is silly, use a 24h clock.
Forget Base 2, that's just straight up Base 1, or should I say Base i for imaginary. I'd like to see that! LolThat's just silly. Your country should use a binary clock. That's what we did, but because the Prime Minister had a fear of the number one, we had to adjust all the clocks to make it from just zeros.
Safe to say, the clocks are still being created seeing as they are pretty much infinite.Forget Base 2, that's just straight up Base 1, or should I say Base i for imaginary. I'd like to see that! Lol
I just tried this code and it didn't work.Mine was a bit different.
Code:i = 1 while i == 1 do term.clear() term.setCursorPos(1,1) print(textutils.formatTime(os.time(), boolean)) sleep(1) end
The term.clear and term.setSursorPos just clear the screen and resets the cursor so it always puts the time on the top line.
The sleep is just so that there is a delay between time refreshes, no point having it refresh every tick.
The while i == 1 do
"code"
end
Is just an infinite Do loop. I set the variable i to be 1 at the start, so it is always true and so always loops. You could replace the first 2 lines with 'while true do' and it should still work.