Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p = peripheral.wrap("right") -- wrap modem
- p.open(1) -- open
- p.open(2) -- close
- p.open(4) -- continue
- while true do
- local event, modemSide, senderChannel, replyChannel = os.pullEvent("modem_message")
- if senderChannel == 1 then
- print("opening")
- turtle.digUp()
- turtle.suckUp()
- turtle.forward()
- end
- if senderChannel == 2 then
- print("closing")
- turtle.back()
- os.pullEvent("modem_message") -- pause for sync
- turtle.placeUp()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement