Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- speaker=peripheral.wrap("right")
- local speaking = false
- local red = true
- while true do
- while red or speaking do --#while we are waiting for redstone or the speaker to finish
- local event = os.pullEvent() --#pull an event
- if event == "speechComplete" then --#if the speaker stopped speaking
- speaking = false --#we are no longer waiting for it to finish
- elseif event == "redstone" then --#if a redstone change occured
- red = false --#we are no longer waiting for redstone
- end
- end
- local input = rs.getBundledInput("back")
- speaking = true --#we're now waiting for it to speak
- red = true --#and for a redstone change to occur
- if colors.test(input,colors.red) then
- speaker.speak("Reactor Critical! Reactor critical! Meltdown Imminent")
- elseif colors.test(input,colors.pink) then
- speaker.speak("Danger! Reactor heat level Critical! Evacuate all none essential Personnel!")
- elseif colors.test(input,colors.green) then
- speaker.speak("Danger! Reactor Heat level at 6000 Degrees!")
- elseif colors.test(input,colors.yellow) then
- speaker.speak("Warning! Reactor Heat Level above Acceptable limit!")
- elseif colors.test(input,colors.blue) then
- speaker.speak("Caution! reactor Heat level at 4000 degrees!")
- elseif colors.test(input,colors.magenta) then
- speaker.speak("Caution! Reactor Heat above Normal Level!")
- elseif colors.test(input,colors.orange) then
- speaker.speak("Attention! Reactor Heat Level at 2000 degrees")
- elseif colors.test(input,colors.white) then
- speaker.speak("attention, Reactor heat level increase detected")
- else
- speaking = false --#we aren't waiting if it didn't speak, this is probably not needed but I like to program for any situation.
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement