Yobi

Printsigns

Feb 27th, 2013
67
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. for name, data in pairs(bullets) do
  15. mon.clear()
  16. mon.setCursorPos(1,1)
  17. mon.setTextScale(tonumber(data["fontsize"]))
  18. for i, v in ipairs(data["message"]) do
  19. print(i, v)
  20. mon.write(v)
  21. mon.setCursorPos(1, i+1)
  22. end
  23. sleep(tonumber(data["timedis"]))
  24. end
  25. end
  26. end
  27.  
  28. function checkfortouch()
  29. e = os.pullEvent("monitor_touch")
  30. return e
  31. end
  32. parallel.waitForAny(display, checkfortouch)
  33. shell.run("hub")
Advertisement
Add Comment
Please, Sign In to add comment