Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- path = 16
- direction = 0
- function plant()
- turtle.select(1)
- if (turtle.getItemCount() <= 10) then
- for z = 3,16 do
- turtle.select(z)
- turtle.transferTo(1)
- end
- elseif (turtle.detect() == false) then
- turtle.place()
- end
- end
- function detect()
- turtle.select(2)
- if (turtle.compare()) then
- felling()
- else
- plant()
- end
- end
- function felling()
- turtle.dig()
- turtle.forward()
- while (turtle.detectUp()) do
- turtle.digUp()
- turtle.up()
- for i = 1,4 do
- turtle.dig()
- turtle.turnRight()
- end
- end
- goDown()
- turtle.back()
- end
- function goDown()
- while (turtle.down()) do
- end
- if (turtle.inspectDown()) then
- local block, type = turtle.inspectDown()
- if (type.name ~= "minecraft:dirt") then
- turtle.digDown()
- goDown()
- end
- end
- end
- function pathing()
- for x = 2,path do
- detect()
- if (direction == 1) then
- turtle.turnRight()
- turtle.suck()
- turtle.forward()
- turtle.turnLeft()
- else
- turtle.turnLeft()
- turtle.suck()
- turtle.forward()
- turtle.turnRight()
- end
- detect()
- end
- if (direction == 1) then
- direction = 0
- bank()
- else
- direction = 1
- end
- end
- function bank()
- for z = 3,15 do
- turtle.select(z)
- turtle.transferTo(1)
- if (turtle.dropDown() == false and turtle.getItemCount() > 0) then
- while (true) do
- turtle.turnRight()
- end
- end
- end
- end
- function main()
- while (true) do
- pathing()
- sleep(60)
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment