Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Befehle
- -- Normal Light on [Zone]
- -- Normal Light off [Zone]
- --Variablen
- wModul = "left" --Angabe fΓΌr die Position des Wirless Modems
- Zone = "Schalfzimmer"
- NormalLight = true
- RedLight = false
- --Code
- function Command()
- senderId, message, protocol = rednet.receive("1900Light")
- if (message == "Normal Light on " .. Zone or message == "Normal Light on ALL") then
- NormalLight = true
- redstone.setOutput("front", NormalLight)
- rednet.send(senderId, NormalLight, "1900Light")
- elseif (message == "Normal Light off " .. Zone or message == "Normal Light off ALL") then
- NormalLight = false
- redstone.setOutput("front", NormalLight)
- rednet.send(senderId, NormalLight, "1900Light")
- elseif (message == "Red Light on " .. Zone or message == "Red Light on ALL") then
- RedLight = true
- redstone.setOutput("back",RedLight)
- rednet.send(senderId, RedLight, "1900Light")
- elseif (message == "Red Light off " .. Zone or message == "Red Light off ALL") then
- RedLight = false
- redstone.setOutput("back", RedLight)
- rednet.send(senderId, RedLight, "1900Light")
- end
- Dashboard()
- end
- function Dashboard()
- shell.run("clear")
- print("Lichtkontroll Einheit")
- print("FΓΌr die Zone: " .. Zone)
- print()
- print("Normales Licht: " .. tostring(NormalLight))
- print("Rotes Licht: " .. tostring(RedLight))
- end
- --Einmal Code
- rednet.open(wModul)
- Dashboard()
- if NormalLight == true then
- redstone.setOutput("front", true)
- else
- redstone.setOutput("front", false)
- end
- if RedLight == true then
- redstone.setOutput("back",true)
- else
- redstone.setOutput("back", false)
- end
- while true do
- Command()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement