Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Minecraft 1.7.10 - ComputerCraft 1.76
- -- Fast updating 24h style clock
- -- with additional "0" before hours before 10:00,
- -- so it looks like 06:37, not 6:37.
- -- Additionally an info displays on the computer running it.
- -- Requires advanced computer and advanced monitor.
- -- Monitor should be 1x1 for best experience.
- -- Sometimes I've seen bugs like "27:45", don't bite me for this.
- -- Also the computer sometimes disables for no reason. (it was herobrine once...)
- -- In future there would be also an IRL-looking
- -- day displayer like "24 Feb 0002" under the clock.
- -- I don't know when, it's a much harder code.
- mon = peripheral.wrap("front") -- Change "front" to any side or peripheral name of your monitor.
- var = 0
- function times()
- print(textutils.formatTime(os.time(), true))
- sleep(0.1)
- end
- term.clear()
- paintutils.drawBox(13,8,38,11,colors.blue)
- term.setTextColor(colors.orange)
- term.setBackgroundColor(colors.black)
- term.setCursorPos(14,9)
- print("This computer is running")
- term.setCursorPos(17,10)
- print("the clock program.")
- term.setCursorPos(25,1)
- term.setTextColor(colors.gray)
- term.setBackgroundColor(colors.black)
- print("Copyright by Kieubasiarz")
- term.setCursorPos(1,1)
- term.redirect(mon)
- term.clear()
- term.setCursorPos(1,1)
- paintutils.drawLine(1,2,7,2,colors.yellow)
- term.setTextColor(colors.orange)
- term.setBackgroundColor(colors.black)
- while true do
- if os.time() < 10 and var == 0 then
- var = 1
- term.setCursorPos(2,1)
- print("0")
- term.setCursorPos(3,1)
- times()
- elseif os.time() < 10 and var == 1 then
- term.setCursorPos(3,1)
- times()
- else
- term.setCursorPos(2,1)
- times()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement