Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- msg = "witherfarm"
- side = "bottom"
- reversed = true
- active = false
- function update()
- if reversed then
- rs.setOutput(side,not active)
- else
- rs.setOutput(side,active)
- end
- end
- update()
- while true do
- event,id,message = os.pullEvent()
- if event == "rednet_message" then
- if message == msg.."on" then
- active = true
- update()
- print("Turned on.")
- rednet.broadcast(msg.." on.")
- elseif message == msg.."off" then
- active = false
- update()
- print("Turned off.")
- rednet.broadcast(msg.." off.")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment