Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local rs = component.redstone
- local term = require("term")
- -- Alarm messages
- local location1 = "Activated Fire Alarm, 41827 Mesawood Ave, Watson Valley"
- local location2 = "Activated Fire Alarm, 47129 Watson Valley Dr., Watson Valley"
- -- Project Red bundled color IDs
- local WHITE = 0
- local ORANGE = 1
- while true do
- local bundled = rs.getBundledInput("back")
- term.clear()
- -- Check white wire (Location 1)
- if (bundled & (1 << WHITE)) ~= 0 then
- print(location1)
- -- Check orange wire (Location 2)
- elseif (bundled & (1 << ORANGE)) ~= 0 then
- print(location2)
- else
- print("No current alarms.")
- end
- os.sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment