Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("top")
- modem.open(1337)
- function performAction(side)
- if side == 1 then
- rs.setOutput("left", true)
- elseif side == 2 then
- rs.setOutput("right", true)
- elseif side == 3 then
- rs.setOutput("left", false)
- elseif side == 4 then
- rs.setOutput("right", false)
- end
- end
- while true do
- event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- if message == "eightOn" then
- performAction(1)
- elseif message == "nineOn" then
- performAction(2)
- elseif message == "eightOff" then
- performAction(3)
- elseif message == "nineOff" then
- performAction(4)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement