Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local count = 0
- local trees = 0
- function Chop()
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() or turtle.detect() do
- turtle.digUp()
- turtle.dig()
- turtle.up()
- count = count + 1
- end
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- while count > 0 do
- turtle.digDown()
- turtle.down()
- turtle.dig()
- count = count - 1
- end
- end
- function clearInv()
- for i = 1, 8 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(16)
- end
- function replant()
- turtle.select(15)
- turtle.place()
- turtle.back()
- turtle.place()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.place()
- turtle.back()
- turtle.place()
- end
- function bonemeal()
- if turtle.getItemCount(16) > 0 then
- grow()
- else print("Out of bonemeal.")
- end
- end
- function grow()
- turtle.select(15)
- while turtle.compare() == true do
- print("Sapling.")
- turtle.select(16)
- turtle.place()
- sleep(10)
- turtle.select(15)
- end
- end
- function wait()
- turtle.select(15)
- while turtle.compare() == true do
- print("Still a sapling...")
- sleep(60)
- end
- print("The tree finally grew, gotta chop it down!")
- turtle.select(1)
- autoChop()
- end
- function autoChop()
- --while true do
- Chop()
- replant()
- clearInv()
- --grow()
- --bonemeal()
- trees = trees + 1
- print("Trees murdered: "..trees)
- end
- end
- wait()
Advertisement
Add Comment
Please, Sign In to add comment