Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... }
- local height = 0
- local sapling = 0
- local meal = 0
- function suppliesLast()
- sapling = 0
- meal = 0
- if turtle.getItemCount(1) > 3 then
- sapling = 1
- end
- if turtle.getItemCount(2) > 0 then
- meal = 2
- end
- return sapling >= 0 and meal >= 0
- end
- function step()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- function stepBack()
- if not turtle.back() then
- turtle.turnRight()
- turtle.turnRight()
- step()
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- function stepUp()
- while not turtle.up() do
- turtle.digUp()
- end
- end
- function stepDown()
- while not turtle.down() do
- turtle.digDown()
- end
- end
- while suppliesLast() do
- height = 0
- turtle.select(sapling)
- step()
- step()
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- stepBack()
- turtle.place()
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- turtle.stepBack()
- turtle.place()
- turtle.select(meal)
- turtle.place()
- while turtle.detect() do
- turtle.dig()
- step()
- turtle.dig()
- step()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- stepBack()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- stepBack()
- stepUp()
- height = height + 1
- end
- for i = 1, height, 1 do
- stepDown()
- end
- turtle.turnRight()
- turtle.turnRight()
- for i = 3, 16, 1 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.turnRight()
- turtle.turnRight()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement