bennyclams

Untitled

Aug 7th, 2026
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. local alarm_relays = {
  2. peripheral.wrap("redstone_relay_0"),
  3. peripheral.wrap("redstone_relay_1"),
  4. peripheral.wrap("redstone_relay_2"),
  5. peripheral.wrap("redstone_relay_3")
  6. }
  7.  
  8. print("Found " .. #alarm_relays .. " alarm relays, toggling alarms")
  9.  
  10. for i, relay in ipairs(alarm_relays) do
  11. if relay.getOutput("top") then
  12. print("Relay " .. i .. " is on, turning off")
  13. relay.setOutput("top", false)
  14. else
  15. print("Relay " .. i .. " is off, turning on")
  16. relay.setOutput("top", true)
  17. end
  18. end
  19.  
  20. local alarmState = false
  21. if alarm_relays[1].getOutput("top") then
  22. alarmState = true
  23. end
  24.  
  25. local door_relay = peripheral.wrap("redstone_relay_11")
  26. print("Found door relay, setting to " .. (alarmState and "on" or "off"))
  27. door_relay.setOutput("back", alarmState)
Advertisement
Add Comment
Please, Sign In to add comment