Advertisement
Guest User

startup

a guest
Oct 25th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. -- Variables
  2.  
  3.  
  4. -- Peripherals
  5. m = peripheral.wrap("top")
  6. m.clear()
  7. m.setCursorPos(1,1)
  8.  
  9. -- CenterText
  10. local function centerText(text)
  11.   x,y = m.getSize()
  12.   x1,y1 = m.getCursorPos()
  13.   m.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
  14.   m.write(text)
  15. end
  16.  
  17. -- Time
  18. function time()
  19. repeat
  20. local nTime = os.time()
  21.   m.setTextColor(16845)
  22.   centerText(""..textutils.formatTime(nTime, false))
  23.   sleep(1)
  24.   term.clear()
  25. until nil
  26. end
  27.  
  28. -- Title
  29. function title()
  30.   m.write("OS")
  31. end
  32.  
  33. -- Functions
  34. title()
  35. time()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement