Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- height = 0
- chopped = 0
- function grow()
- print("Growing")
- turtle.select(2)
- turtle.place()
- turtle.select(4)
- while not turtle.compare() do
- turtle.select(3)
- turtle.place()
- turtle.select(4)
- end
- end
- function adjust()
- print("Adjusting")
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- end
- function tapUp1()
- print("Tapping up 1")
- turtle.select(4)
- while turtle.compare() do
- turtle.select(5)
- turtle.place()
- turtle.digUp()
- turtle.up()
- turtle.select(4)
- height = height + 1
- end
- print("Height " .. height)
- turtle.dig()
- end
- function tapUp2()
- print("Tapping up 2")
- turtle.select(5)
- for i=2,height do
- turtle.place()
- turtle.digUp()
- turtle.up()
- end
- end
- function tapDown1()
- print("Tapping down 1")
- turtle.select(5)
- for i=1,height do
- turtle.digDown()
- turtle.down()
- turtle.place()
- end
- end
- function tapDown2()
- print("Tapping down 2")
- turtle.select(5)
- for i=2,height do
- turtle.place()
- turtle.dig()
- turtle.digDown()
- turtle.down()
- end
- end
- function treeTap()
- grow()
- tapUp1()
- adjust()
- tapDown1()
- adjust()
- tapUp2()
- adjust()
- tapDown2()
- adjust()
- chopped = chopped + 1
- print("Chopped " .. chopped)
- end
- function getBoneMeal()
- print("Getting bone meal")
- turtle.turnLeft() turtle.turnLeft()
- turtle.forward() turtle.forward() turtle.forward()
- turtle.select(3)
- turtle.suck(48)
- turtle.turnLeft() turtle.turnLeft()
- turtle.forward() turtle.forward() turtle.forward()
- end
- function getCoal()
- print("Getting coal")
- turtle.turnLeft()
- turtle.forward() turtle.forward()
- turtle.turnLeft()
- turtle.forward() turtle.forward() turtle.forward()
- turtle.select(1)
- turtle.suck(48)
- turtle.turnLeft() turtle.turnLeft()
- turtle.forward() turtle.forward() turtle.forward()
- turtle.turnRight()
- turtle.forward() turtle.forward()
- turtle.turnLeft()
- end
- function restock()
- if turtle.getItemCount(1) < 4 then
- getCoal()
- end
- if turtle.getItemCount(3) < 16 then
- getBoneMeal()
- end
- end
- function refuel()
- if turtle.getFuelLevel() < 50 then
- turtle.select(1)
- turtle.refuel(4)
- end
- end
- turtle.select(6)
- while turtle.compareDown() do
- refuel()
- restock()
- treeTap()
- height = 0
- turtle.select(6)
- end
- print("Terminated after chopping " .. chopped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement