Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variablen
- -- Protokolle
- CodeInfo = "1591"
- CodeWarn = "1592"
- CodeKrit = "1593"
- CodeSend = "1594"
- -- Programm
- shell.run("clear")
- print("Protokoll Zentrale")
- print("Lade alle Funktionen")
- rednet.open("top")
- redstone.setOutput("left", true)
- function dashboard(id, nachricht, status)
- shell.run("clear")
- print("Protokoll Zentrale")
- print()
- print("Nachricht erhalten von: " .. id)
- print("Nachricht: " .. nachricht)
- print("Status: " .. status)
- end
- function alarm()
- redstone.setOutput("right", true)
- sleep(5)
- redstone.setOutput("right", false)
- end
- while true do
- local senderId, message = rednet.receive()
- if string.sub(message, 0, string.len(CodeInfo)) == CodeInfo then
- nachricht = string.sub(message, string.len(CodeInfo) + 1)
- dashboard(senderId, string.sub(message, string.len(CodeInfo) + 1), "Information")
- rednet.broadcast(CodeSend .. nachricht)
- elseif string.sub(message, 0, string.len(CodeWarn)) == CodeWarn then
- nachricht = string.sub(message, string.len(CodeInfo) + 1)
- dashboard(senderId, string.sub(message, string.len(CodeInfo) + 1), "Warnung")
- rednet.broadcast(CodeSend .. nachricht)
- elseif string.sub(message, 0, string.len(CodeKrit)) == CodeKrit then
- nachricht = string.sub(message, string.len(CodeInfo) + 1)
- dashboard(senderId, string.sub(message, string.len(CodeInfo) + 1), "Kritisch")
- rednet.broadcast(CodeSend .. nachricht)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement