Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- mon = peripheral.wrap("left")
- laut = peripheral.wrap("top")
- druck = peripheral.wrap("bottom")
- rednet.send(6,"start")
- alarm = 0
- cursor = 1
- mel = 1
- mon.setTextScale(0.5)
- fs.makeDir("BSMA")
- while true do
- id,msg = rednet.receive(20)
- if alarm == 0 then
- rednet.send(6,"start")
- end
- if id == 6 and msg == "quit" then
- if alarm == 0 then
- shell.run("quit")
- end
- end
- if id == 11 and msg == "quit" then
- if alarm == 0 then
- shell.run("quit")
- end
- end
- if id == 11 and msg == "Alarm" then
- ort = "Industriepark Witthoven"
- melderart = "Manuelle Übertragungseinrichtung"
- melderbesch = "Tablet"
- end
- if id == 3 and msg ~= "alarm" then
- ort = "Verwaltung drP Service AG"
- if msg == "01/01" or msg == "01/02" then
- melderart = "Automatische Übertragungseinrichtung"
- melderbesch = "Flammenmelder"
- else
- melderart = "Manuelle Übertragungseinrichtung"
- melderbesch = "Handfeuermelder"
- end
- end
- if id == 11 or id == 3 then
- if msg == "alarm" then
- rednet.send(6,"alarm")
- rednet.send(9,"alarm")
- rednet.send(12,"alarm")
- rednet.send(13,"alarm")
- sleep(1.5)
- rednet.send(14,"alarm")
- sleep(1.5)
- rednet.send(15,"alarm")
- sleep(1.5)
- rednet.send(16,"alarm")
- alarm = 1
- local file = fs.open("BSMA/AktivAlarm","a")
- file.writeLine(id)
- elseif msg == "Alarm" then
- rednet.send(6,"alarm")
- rednet.send(9,"Aalarm")
- rednet.send(12,"Aalarm")
- rednet.send(13,"alarm")
- sleep(1.5)
- rednet.send(14,"alarm")
- sleep(1.5)
- rednet.send(15,"alarm")
- sleep(1.5)
- rednet.send(16,"alarm")
- end
- if msg ~= "alarm" or id == 11 then
- mon.setCursorPos(1,cursor)
- if msg ~= "alarm" and id ~= 11 then
- mon.write("BSMA | Aktiver BRANDMELDEALARM")
- elseif id == 11 then
- mon.write("BSMA | Aktiver ALARM")
- end
- cursor = cursor+1
- mon.setCursorPos(1,cursor)
- mon.write("---------------------------------------------------")
- cursor = cursor+1
- mon.setCursorPos(1,cursor)
- mon.write("Meldung ")
- mon.write(mel)
- mon.write(":")
- cursor = cursor+1
- mon.setCursorPos(1,cursor)
- mon.write("Gebäude: ")
- mon.write(ort)
- cursor = cursor+1
- mon.setCursorPos(1,cursor)
- mon.write("Melderart: ")
- mon.write(melderart)
- cursor = cursor+1
- mon.setCursorPos(1,cursor)
- mon.write("Melderbeschreibung: ")
- mon.write(melderbesch)
- cursor = cursor+1
- mon.setCursorPos(1,cursor)
- mon.write("Meldernummer: ")
- mon.write(msg)
- cursor = cursor+1
- mon.setCursorPos(1,cursor)
- mon.write("---------------------------------------------------")
- cursor = cursor+1
- mel = mel+1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment