This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Jester's profile picture

Clock

Started by Jester, 09 April 2016 - 10:36 PM
Jester #1
Posted 10 April 2016 - 12:36 AM
I'm trying to make a real life clock. So It will display my GMT time in minecraft without using a link http


term.clear()
term.setCursorPos(1, 1)
timeH = 1
timeM = 20
timeS = 0
if timeS == '60' then
timeM = timeM + 1
timeS = timeS - 60
if timeM == '60' then
timeH = timeH + 1
timeM = timeM - 60
if timeH == '23' and timeM == '60' then
timeH = timeH - 23
if timeM == '59' and timeS == '60' then
timeH = timeM - 59

term.write(timeH)
term.write(timeM)
term.write(timeS)
sleep(5)
end
end
end
end
KingofGamesYami #2
Posted 10 April 2016 - 12:47 AM
What problem are you having with your program?
Jester #3
Posted 27 April 2016 - 12:51 PM
I want to make a real life clock, So I can view the times of canada, USA, parts of europe in seperate clocks.
The program I made worked for 1 min and stopped after that.
I want it too loop and display the GMT time on a monitor.

Something like this but in a digital modus.
https://gigaom.com/wp-content/uploads/sites/1/2010/07/clocks.jpg
Edited on 27 April 2016 - 10:52 AM
Lupus590 #4
Posted 27 April 2016 - 01:22 PM
you want a while loop: http://www.tutorialspoint.com/lua/lua_while_loop.htm