Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- local tree = 0
- local height = 0
- function PlantTree()
- if turtle.getItemCount(1) == 0 then
- turtle.back()
- turtle.turnRight()
- turtle.select(1)
- turtle.suck()
- turtle.turnRight()
- ClearInv()
- end
- print("PlantTree #" .. tree)
- turtle.select(1)
- turtle.place()
- BoneMeal()
- end
- function BoneMeal()
- print("BoneMeal #" .. tree)
- turtle.select(2)
- while true do
- local bool, block = turtle.inspect()
- if block.name == "minecraft:log" then
- BreakTree()
- end
- turtle.place()
- end
- end
- function BreakTree()
- print("BreakTree #" .. tree)
- turtle.dig()
- turtle.forward()
- while true do
- bool, block = turtle.inspectUp()
- if block.name == "minecraft:log" then
- turtle.digUp()
- turtle.up()
- height = height + 1
- end
- if block.name ~= "minecraft:log" then
- while true do
- if height ~= 0 then
- turtle.down()
- height = height - 1
- end
- if height == 0 then
- turtle.back()
- tree = tree + 1
- sleep(20)
- PlantTree()
- end
- end
- end
- end
- end
- function ClearInv()
- turtle.select(3)
- turtle.drop()
- turtle.select(4)
- turtle.drop()
- turtle.select(5)
- turtle.drop()
- turtle.select(6)
- turtle.drop()
- turtle.select(7)
- turtle.drop()
- turtle.select(8)
- turtle.drop()
- turtle.select(9)
- turtle.drop()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- PlantTree()
- end
- PlantTree()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement