Vincent38190

DisplaySystem

May 21st, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. if not fs.exists("/Fsociety/data/side") then
  2. print("ERROR NO SIDE FILE")
  3. os.reboot()
  4. end
  5. sideFile = fs.open("/Fsociety/data/side","r")
  6. modemSide = sideFile.readLine()
  7. monitorSide = sideFile.readLine()
  8. sideFile.close()
  9.  
  10. --------------------------------------------
  11. --                                        --
  12. --            Display System from         --
  13. --            Security System V0.1        --
  14. --            By Fsociety                 --
  15. --                                        --
  16. --------------------------------------------
  17.  
  18. local mon = peripheral.wrap(monitorSide)
  19. local m = peripheral.wrap(modemSide)
  20. m.open(100)
  21. mon.clear()
  22. while true do
  23.   local event , param1 , param2 , param3 , param4 = os.pullEvent()
  24.   if event == "modem_message" then
  25.     mon.clear()
  26.     local w, h = mon.getSize()
  27.     mon.setCursorPos(1,h/2)
  28.     mon.write(param4)
  29.   end
  30.   sleep(0.1)
  31. end
Add Comment
Please, Sign In to add comment