Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- local function tryDigDown()
- if turtle.digDown() then
- return true
- end
- return false
- end
- local function tryDown()
- if turtle.down() then
- print("Moving down")
- return true
- else
- if tryDigDown() then
- print("Moving down")
- turtle.down()
- return true
- end
- end
- print("Can't dig down")
- return false
- end
- local function start()
- x = 0
- while tryDown() do
- x = x + 1
- print("Dug to level: "..x)
- end
- print("Cannot dig further. Bedrock likely reached")
- print("Returning to surface")
- while x > 0 do
- if turtle.up() then
- x = x - 1
- else
- sleep(1)
- end
- end
- print("Setting the next position")
- turtle.forward()
- end
- local id, msg, dist = rednet.receive()
- if msg == "excavate" then
- start()
- end
Advertisement
Add Comment
Please, Sign In to add comment