Guest User

Untitled

a guest
Dec 15th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. local sSide = "back"
  2.  
  3. local function printCenter(mon, txt)
  4. local w, h = mon.getSize()
  5. local x = math.floor((w / 2) - (#txt / 2))
  6. local y = math.floor((h / 2))
  7. mon.setCursorPos(x, y)
  8. mon.write(txt)
  9. end
  10.  
  11. local monitor = peripheral.wrap(sSide)
  12.  
  13. while true do
  14. shell.run("clear")
  15. local nTime = os.time()
  16. printCenter(monitor, textutils.formatTime(nTime, true)))
  17. sleep(1)
  18. end
Add Comment
Please, Sign In to add comment