548219

Untitled

Feb 2nd, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. x,y = monitor.getSize()
  2.  
  3. function centerText(text, yp)
  4. cx = math.ceil((x/2)-(string.len(text)/2))
  5. monitor.setCursorPos(cx,yp)
  6. monitor.write(text)
  7. end
  8.  
  9. local time = os.time()
  10. time = textutils.formatTime(time,false)
  11. term.clear()
  12. term.setCursorPos(1,1)
  13. write("Please input status string!: ")
  14. inputString = read()
  15. term.setCursorPos(1,2)
  16. write("Status string input recieved! - '")
  17. write(inputString)
  18. write("'")
  19. term.setCursorPos(1,3)
  20. write("Text displayed! - ")
  21. write("[")
  22. write(time)
  23. write("]")
  24. term.setCursorPos(1,4)
  25. monitor = peripheral.wrap("*MonitorPos*")
  26. monitor.clear()
  27. monitor.setTextScale(1)
  28. centerText("Welcome to Mineland border", 1)
  29. centerText("checkpoint '*CheckpointName*'", 2)
  30. centerText(inputString, 4)
  31.  
  32. --Use centerText_API!
Advertisement
Add Comment
Please, Sign In to add comment