Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("top")
- rednet.open("top")
- local piston = "back"
- local towerid = "pjwater2"
- print("Listening on " .. towerid)
- redstone.setOutput(piston, true)
- while true do
- event, senderId, message, protocol = os.pullEvent("rednet_message")
- if protocol == towerid then
- if message == "stopWater" then
- print("Stopping water")
- redstone.setOutput(piston, true)
- elseif message == "startWater" then
- print("Starting water")
- redstone.setOutput(piston, false)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment