Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.find("modem")
- local outputMap = {
- [6] = "left",
- [7] = "right",
- [8] = "front",
- [9] = "back",
- [10] = "bottom"
- }
- term.clear()
- term.setCursorPos(1,1)
- print("Running")
- while rs.getInput("front") == false do
- modem.open(27)
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- modem.close(27)
- if outputMap[replyChannel] and message == "On" then
- rs.setOutput(outputMap[replyChannel], true)
- end
- if outputMap[replyChannel] and message == "Off" then
- rs.setOutput(outputMap[replyChannel], false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement