Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variablen
- -- Protokolle
- CodeSend = "1594"
- CodeSpez = "1595"
- -- Start
- shell.run("clear")
- rednet.open("top")
- print("Warte auf Special Protokolle")
- -- Funkktionen
- function alarm()
- redstone.setOutput("right", true)
- sleep(7)
- redstone.setOutput("right", false)
- end
- function dashboard(id,aktion,protokoll,nachricht)
- shell.run("clear")
- print("Special Protokoll Zentrale")
- -- print("Neue Nachicht von: " .. id)
- print("Protokoll: " .. protokoll)
- print("Nachricht: " .. nachricht)
- print("Aktion: " .. aktion)
- end
- -- Loader
- while true do
- local senderId, message = rednet.receive()
- local protokoll = string.sub(message, 0, string.len(CodeSpez))
- local nachricht = string.sub(message, string.len(CodeSpez) + 1)
- if string.sub(message, 0, string.len(CodeSpez)) == CodeSpez then
- if string.sub(message, string.len(CodeSpez) + 1) == "alarm" then
- dashboard(senderId, "Starte 7 Sekunden Alarm", protokoll, nachricht)
- alarm()
- print("Aktion: Alarm gestoppt")
- elseif string.sub(message, string.len(CodeSpez) + 1) == "alarmstart" then
- dashboard(senderId, "Starte Alarm", protokoll, nachricht)
- redstone.setOutput("right", true)
- elseif string.sub(message, string.len(CodeSpez) + 1) == "alarmstop" then
- dashboard(senderId, "Stoppe Alarm", protokoll, nachricht)
- redstone.setOutput("right", false)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement