Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local receivers = {36, 37, 38, 39, 40}
- local function send(msg)
- for i = 1, #receivers do
- rednet.send(receivers[i], msg)
- end
- end
- rednet.open("top")
- while true do
- local state = rs.getInput("back")
- print("Redstone state change detected. new state: ", state)
- if state then
- send("off")
- else
- send("on")
- end
- os.pullEvent("redstone")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement