bennyclams

Untitled

Aug 7th, 2026
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. local relays = { peripheral.find("redstone_relay") }
  2.  
  3. if #relays == 0 then
  4. print("No redstone relays found")
  5. return
  6. end
  7.  
  8. print("Found " .. #relays .. " redstone relays, toggling alarms")
  9.  
  10. for i, relay in ipairs(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
Advertisement
Add Comment
Please, Sign In to add comment