Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- while true do
- event, id, text = os.pullEvent()
- if event == "rednet_message" then
- if text == "excavate" then
- shell.run(""..text, "5")
- elseif text == "go up" then
- for x = 0, 5, 1 do
- if turtle.detectUp() then
- turtle.digUp()
- x=x+1
- else
- turtle.up()
- end
- end
- elseif text == "go right" then
- turtle.turnRight()
- for x = 0, 5, 1 do
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- x=x+1
- end
- end
- turtle.turnLeft()
- elseif text == "go left" then
- turtle.turnLeft()
- for x = 0, 5, 1 do
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- x=x+1
- end
- end
- turtle.turnRight()
- elseif text == "go down" then
- for x = 0, 5, 1 do
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- x=x+1
- end
- elseif text == "go back" then
- turtle.turnRight()
- turtle.turnRight()
- for x = 0, 5, 1 do
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- x=x+1
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment