Godleydemon

moviePlay

Jun 21st, 2013
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. monitor = peripheral.wrap("left")
  2. term.redirect(monitor)
  3.  
  4. local function PrintCenter(msg)
  5. local msgLen = string.len(msg)
  6. local screenWidth,_ = term.getSize()
  7. local xCoords = tonumber(math.ceil((screenWidth / 2) - (msgLen / 2)))
  8. local yCoords = 10
  9. term.setCursorPos(xCoords,yCoords)
  10. end
  11.  
  12. function touch()
  13. if os.pullEvent("monitor_touch")
  14. then shell.run("rom/programs/secret/alongtimeago")
  15. end
  16. end
  17.  
  18. function text()
  19. monitor.setTextScale(1)
  20. PrintCenter("[Play]")
  21. print("[Play]")
  22. end
  23.  
  24.  
  25. while true do
  26. text()
  27. touch()
  28. end
Add Comment
Please, Sign In to add comment