Advertisement
Mackan90096

Untitled

Jul 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. local monitorSide = "right"
  2. local stationName = "Spawn Station"
  3.  
  4. local mon = peripheral.wrap(monitorSide)
  5.  
  6. local function centerPrint(msg, y)
  7. local w, h = mon.getSize()
  8. mon.setCursorPos(math.floor(((w+3)-#msg)/2) + (#msg % 2 == 0 and 1 or 0), y or h/2)
  9. mon.write(msg)
  10. end
  11.  
  12.  
  13. while true do
  14. local time = os.time()
  15. local formattedTime = textutils.formatTime(time, false)
  16.  
  17. mon.clear()
  18. mon.setTextScale(1.5)
  19. term.redirect(mon)
  20. centerPrint(stationName, 1)
  21. centerPrint("Danger! High Voltage!", 2)
  22. centerPrint(formattedTime, 3)
  23. os.sleep(0.05)
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement