Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sapling = 15
- local bonemeal = 16
- function bone ()
- if turtle.getItemCount(bonemeal) > 1 then
- turtle.select(bonemeal)
- turtle.place()
- end
- end
- function plant ()
- if turtle.getItemCount(sapling) < 5 then
- turtle.turnLeft()
- turtle.select(sapling)
- turtle.drop()
- turtle.suck()
- while turtle.getItemCount(sapling) < 5 do
- print("Waiting for more saplings")
- sleep(60)
- turtle.drop()
- turtle.suck()
- end
- turtle.turnRight()
- end
- turtle.select(sapling)
- sleep(1)
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- turtle.back()
- turtle.place()
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- turtle.back()
- turtle.place()
- end
- function detect ()
- turtle.select(sapling)
- while turtle.compare() do
- bone()
- sleep(1)
- turtle.select(sapling)
- end
- end
- function chop ()
- local height = 1
- local downSteps = 1
- turtle.select(1)
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do
- turtle.dig()
- turtle.digUp()
- turtle.up()
- height = height + 1
- end
- turtle.dig()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- while downSteps < height do
- turtle.dig()
- turtle.digDown()
- turtle.down()
- downSteps = downSteps + 1
- end
- turtle.dig()
- turtle.turnLeft()
- turtle.back()
- turtle.turnRight()
- turtle.back()
- end
- function empty ()
- for slot = 1, 14 do
- if turtle.getItemCount(slot) > 0 then
- turtle.select(slot)
- turtle.dropUp()
- end
- end
- end
- while true do
- plant()
- bone()
- detect()
- chop()
- empty()
- end
Advertisement
Add Comment
Please, Sign In to add comment