Skillkiller

Lichtkontroll Einheit | Nur Rote Lampe

Sep 3rd, 2016
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Befehle
  2. -- Red Light on [Zone]
  3. -- Red Light off [Zone]
  4.  
  5. --Variablen
  6. wModul = "bottom" --Angabe für die Position des Wirless Modems
  7. Zone = "Aussenlampen"
  8. NormalLight = true
  9. RedLight = false
  10.  
  11. --Code
  12. function Command()
  13. senderId, message, protocol = rednet.receive("1900Light")
  14. if (message == "Red Light on " .. Zone or message == "Red Light on ALL") then
  15. RedLight = true
  16. redstone.setOutput("top", RedLight)
  17. rednet.send(senderId, RedLight, "1900Light")
  18.  
  19. elseif (message == "Red Light off " .. Zone or message == "Red Light off ALL") then
  20. RedLight = false
  21. redstone.setOutput("top", RedLight)
  22. rednet.send(senderId, RedLight, "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: " .. "Wurde komplett deaktiviert!")
  33. print("Rotes Licht:    " .. tostring(RedLight))
  34. end
  35.  
  36. --Einmal Code
  37. rednet.open(wModul)
  38. Dashboard()
  39.  
  40. if RedLight == true then
  41. redstone.setOutput("top", true)
  42. else
  43. redstone.setOutput("top", false)
  44. end
  45.  
  46. while true do
  47. Command()
  48. end
Advertisement
Add Comment
Please, Sign In to add comment