Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("back")
- modem.open(00005)
- redstone.setOutput("right",true)
- term.clear()
- term.setCursorPos(1,1)
- print("Waiting on message.")
- while true do
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- term.clear()
- term.setCursorPos(1,1)
- print("Message received: "..message)
- print("Channel: "..senderChannel)
- if senderChannel == 5 and message == "off" then
- redstone.setOutput("right",false)
- elseif senderChannel == 5 and message == "on" then
- redstone.setOutput("right",true)
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment