Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- rednet.open("bottom")
- laut = peripheral.wrap("right")
- mon = peripheral.wrap("left")
- alarm = 0
- sound = 1
- sts = 0
- while true do
- if alarm == 0 then
- id,msg = rednet.receive()
- else
- id,msg = rednet.receive(5)
- end
- if id == nil then
- id = 4
- end
- if id == 4 or id == 6 or id == 11 then
- if msg == "quit" then
- mon.clear()
- os.reboot()
- end
- if msg == "aquit" then
- sound = 0
- end
- if msg == "alarm" or msg == "Aalarm" or alarm == 1 or msg == "Astörung" then
- if alarm == 0 then
- mon.setCursorPos(1,1)
- if msg == "alarm" then
- mon.write("Aktiver Brandmeldealarm")
- elseif msg == "Aalarm" then
- mon.write("Aktiver Alarm")
- elseif msg == "Astörung" then
- mon.write("BSMA STÖRUNG")
- sts = 1
- end
- end
- alarm = 1
- if sts == 0 then
- schleife = 40
- elseif sts == 1 then
- schleife = 20
- end
- while (schleife > 1) do
- rs.setOutput("top",true)
- if sound == 1 then
- if sts == 0 then
- laut.playNote("pling",15,5)
- elseif sts == 1 then
- laut.playNote("harp",15,10)
- end
- end
- if sts == 0 then
- sleep(0.25)
- elseif sts == 1 then
- sleep(1)
- end
- rs.setOutput("top",false)
- if sound == 1 then
- if sts == 0 then
- laut.playNote("pling",15,5)
- elseif sts == 1 then
- laut.playNote("harp",15,10)
- end
- end
- if sts == 0 then
- sleep(0.25)
- elseif sts == 1 then
- sleep(1)
- end
- schleife = schleife-1
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment