Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sides = {"left", "right", "top", "bottom", "front", "back"}
- channel = os.getComputerID()
- print("Channel: " .. channel)
- rednet.open("front", channel)
- while true do
- id, msg = rednet.receive()
- if msg < 1 and msg > 6 and msg < 11 and msg > 16 then
- print("Invalid message: " .. msg)
- else
- state = false
- if msg > 10 then
- state = true
- msg = msg - 10
- end
- print("Set ", sides[msg], " to ", state)
- rs.setOutput(sides[msg], state)
- end
- end
Add Comment
Please, Sign In to add comment