bennyclams

Untitled

Aug 7th, 2026
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 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 door_relays = {
  21. peripheral.wrap("redstone_relay_10"),
  22. peripheral.wrap("redstone_relay_11"),
  23. peripheral.wrap("redstone_relay_12")
  24. }
  25.  
  26. print("Found " .. #door_relays .. " door relays, toggling doors")
  27.  
  28. for i, relay in ipairs(door_relays) do
  29. if relay.getOutput("top") then
  30. print("Relay " .. i .. " is on, turning off")
  31. relay.setOutput("top", false)
  32. else
  33. print("Relay " .. i .. " is off, turning on")
  34. relay.setOutput("top", true)
  35. end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment