Advertisement
Skillkiller

Lichtkontroll Einheit | Nur Normale Lampe

Jul 25th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Befehle
  2. -- Normal Light on [Zone]
  3. -- Normal Light off [Zone]
  4.  
  5. --Variablen
  6. wModul = "left" --Angabe fΓΌr die Position des Wirless Modems
  7. Zone = "Gang-Zentrale"
  8. NormalLight = true
  9. RedLight = false
  10.  
  11. --Code
  12. function Command()
  13. senderId, message, protocol = rednet.receive("1900Light")
  14. if (message == "Normal Light on " .. Zone or message == "Normal Light on ALL") then
  15. NormalLight = true
  16. redstone.setOutput("front", NormalLight)
  17. rednet.send(senderId, NormalLight, "1900Light")
  18.  
  19. elseif (message == "Normal Light off " .. Zone or message == "Normal Light off ALL") then
  20. NormalLight = false
  21. redstone.setOutput("front", NormalLight)
  22. rednet.send(senderId, NormalLight, "1900Light")
  23. end
  24. Dashboard()
  25. end
  26.  
  27. function Dashboard()
  28. shell.run("clear")
  29. print("Lichtkontroll Einheit")
  30. print("FΓΌr die Zone: " .. Zone)
  31. print()
  32. print("Normales Licht: " .. tostring(NormalLight))
  33. print("Rotes Licht:    " .. "Wurde komplett deaktiviert!")
  34. end
  35.  
  36. --Einmal Code
  37. rednet.open(wModul)
  38. Dashboard()
  39.  
  40. if NormalLight == true then
  41. redstone.setOutput("front", true)
  42. else
  43. redstone.setOutput("front", false)
  44. end
  45.  
  46. while true do
  47. Command()
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement