Yobi

Tododisplay

Mar 14th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bullets = {}
  2. if fs.exists("signs") then
  3. file = fs.open("signs", "r")
  4. bullets = textutils.unserialize(file.readAll())
  5. file.close()
  6. else
  7. print("There are no bulletins to display!")
  8. shell.run("hub")
  9. end
  10.  
  11. function display()
  12. mon = peripheral.wrap("right")
  13. while true do
  14. i = 1
  15. for name, data in pairs(bullets) do
  16. mon.setCursorPos(1,i)
  17. i = i+1
  18. mon.setTextScale(tonumber(data["fontsize"]))
  19. for i, v in ipairs(data["message"]) do
  20. print(i, v)
  21. mon.write(v)
  22. mon.setCursorPos(1, i+1)
  23. sleep(1)
  24. end
  25. end
  26. end
  27. end
  28.  
  29. function checkfortouch()
  30. e = os.pullEvent("monitor_touch")
  31. return e
  32. end
  33. parallel.waitForAny(display, checkfortouch)
  34. shell.run("hub")
Advertisement
Add Comment
Please, Sign In to add comment