Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local alarm_relays = {
- peripheral.wrap("redstone_relay_0"),
- peripheral.wrap("redstone_relay_1"),
- peripheral.wrap("redstone_relay_2"),
- peripheral.wrap("redstone_relay_3")
- }
- print("Found " .. #alarm_relays .. " alarm relays, toggling alarms")
- for i, relay in ipairs(alarm_relays) do
- if relay.getOutput("top") then
- print("Relay " .. i .. " is on, turning off")
- relay.setOutput("top", false)
- else
- print("Relay " .. i .. " is off, turning on")
- relay.setOutput("top", true)
- end
- end
- local door_relays = {
- peripheral.wrap("redstone_relay_10"),
- peripheral.wrap("redstone_relay_11"),
- peripheral.wrap("redstone_relay_12")
- }
- print("Found " .. #door_relays .. " door relays, toggling doors")
- for i, relay in ipairs(door_relays) do
- if relay.getOutput("top") then
- print("Relay " .. i .. " is on, turning off")
- relay.setOutput("top", false)
- else
- print("Relay " .. i .. " is off, turning on")
- relay.setOutput("top", true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment