Advertisement
Skillkiller

Meldezentrale

Feb 8th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. -- Variabeln
  2. RedSeite = "bottom"
  3. Modul = "back"
  4. nachricht = ""
  5.  
  6. -- Start
  7. rednet.open(Modul)
  8. redstone.setOutput(RedSeite, true)
  9. monitor = peripheral.wrap("right")
  10. monitor.write("Warte auf Nachricht")
  11.  
  12. function dashboard()
  13. shell.run("clear")
  14. monitor.write("Neuste Nachricht: ")
  15. monitor.write(nachricht)
  16. end
  17.  
  18. function blink()
  19. for i = 1, 5 do
  20.  redstone.setOutput(RedSeite, false)
  21.  sleep(0.2)
  22.  redstone.setOutput(RedSeite, true)
  23.  sleep(0.2)
  24. end
  25. end
  26.  
  27. -- Loader
  28. while true do
  29. senderId, message, protocol = rednet.receive()
  30. print("Sender: " .. senderId)
  31. print("Protocol: " .. protocol)
  32. nachricht = message
  33. parallel.waitForAll(dashboard, blink)
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement