Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function toggleTurn(dir)
- if dir == "right" then
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- return("left")
- else
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- return("right")
- end
- end
- while true do
- n = 6
- turtle.select(1)
- print("Awaiting...")
- turtle.place()
- while turtle.compare() do
- sleep(1)
- end
- print("Tree detected")
- turtle.back()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- while true do
- turtle.up()
- n = n+1
- if turtle.detectUp() then
- break
- elseif turtle.detect() then
- break
- end
- end
- if not turtle.detect() then
- turtle.digUp()
- turtle.up()
- end
- turn = "right"
- for a =1, 2 do
- for b =1, 5 do
- for c =1, 4 do
- turtle.dig()
- turtle.forward()
- end
- if b < 5 then
- turn = toggleTurn(turn)
- end
- end
- turtle.digUp()
- turtle.up()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- for a = 1,2 do
- turn = "right"
- for b = 1,3 do
- for c = 1,2 do
- turtle.dig()
- turtle.forward()
- end
- if b < 3 then
- turn = toggleTurn(turn)
- end
- end
- turtle.digUp()
- turtle.up()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- for i =1, n do
- turtle.dig()
- turtle.down()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement