DrFair

Time monitor

Apr 9th, 2014
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. monitorSide = "left"
  2. monitorScale = 3
  3.  
  4. if not fs.exists( "fui" ) then
  5. print( "Performing first time setup." )
  6. shell.run( "pastebin","get", "306Ns1qg", "fui" )
  7. print("Finished. Please run program again.")
  8. error()
  9. end
  10.  
  11. monitor = peripheral.wrap( monitorSide )
  12. monitor.setTextScale( monitorScale )
  13. os.loadAPI("fui")
  14. fui.setMonitorSide( monitorSide )
  15. os.sleep(5)
  16. w,h = fui.getSize()
  17. line = {}
  18.  
  19. while true do
  20. line[1] = "Day #"..os.day()
  21. line[2] = textutils.formatTime(os.time(),false)
  22. fui.clear()
  23. for i=1,#line do
  24. fui.drawAlignText( line[i].."", "mid", w/2+1, 2+i, "white" )
  25. end
  26. os.sleep(0.8)
  27. end
Advertisement
Add Comment
Please, Sign In to add comment