Advertisement
Schiffe_Rat

Minecraft Fancy Clock

Feb 24th, 2016
776
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.64 KB | None | 0 0
  1. -- Minecraft 1.7.10 - ComputerCraft 1.76
  2. -- Fast updating 24h style clock
  3. -- with additional "0" before hours before 10:00,
  4. -- so it looks like 06:37, not 6:37.
  5. -- Additionally an info displays on the computer running it.
  6. -- Requires advanced computer and advanced monitor.
  7. -- Monitor should be 1x1 for best experience.
  8.  
  9. -- Sometimes I've seen bugs like "27:45", don't bite me for this.
  10. -- Also the computer sometimes disables for no reason. (it was herobrine once...)
  11.  
  12. -- In future there would be also an IRL-looking
  13. -- day displayer like "24 Feb 0002" under the clock.
  14. -- I don't know when, it's a much harder code.
  15.  
  16. mon = peripheral.wrap("front") -- Change "front" to any side or peripheral name of your monitor.
  17. var = 0
  18.  
  19. function times()
  20.  print(textutils.formatTime(os.time(), true))
  21.  sleep(0.1)
  22. end
  23.  
  24. term.clear()
  25. paintutils.drawBox(13,8,38,11,colors.blue)
  26. term.setTextColor(colors.orange)
  27. term.setBackgroundColor(colors.black)
  28. term.setCursorPos(14,9)
  29. print("This computer is running")
  30. term.setCursorPos(17,10)
  31. print("the clock program.")
  32. term.setCursorPos(25,1)
  33. term.setTextColor(colors.gray)
  34. term.setBackgroundColor(colors.black)
  35. print("Copyright by Kieubasiarz")
  36. term.setCursorPos(1,1)
  37. term.redirect(mon)
  38. term.clear()
  39. term.setCursorPos(1,1)
  40. paintutils.drawLine(1,2,7,2,colors.yellow)
  41. term.setTextColor(colors.orange)
  42. term.setBackgroundColor(colors.black)
  43.  
  44. while true do
  45.  if os.time() < 10 and var == 0 then
  46.   var = 1
  47.   term.setCursorPos(2,1)
  48.   print("0")
  49.   term.setCursorPos(3,1)
  50.   times()
  51.  elseif os.time() < 10 and var == 1 then
  52.   term.setCursorPos(3,1)
  53.   times()
  54.  else
  55.   term.setCursorPos(2,1)
  56.   times()
  57.  end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement