Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- z = 0
- function moveUp()
- if turtle.up() then
- z = z + 1
- return true
- end
- end
- function moveDown()
- if turtle.down() then
- z = z - 1
- return true
- end
- end
- function mineUp()
- turtle.dig()
- turtle.digUp()
- moveUp()
- end
- function dropOff()
- print("Dropping off items..")
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(1)
- turtle.drop(turtle.getItemCount(1)-1)
- turtle.turnRight()
- turtle.turnRight()
- end
- function chopTree()
- print("Chopping tree.")
- turtle.select(1)
- while turtle.compare() do
- mineUp()
- end
- for i=1,z do
- moveDown()
- end
- end
- function waitGrow()
- print("Waiting for grow..")
- while not turtle.compare() do
- os.sleep(1)
- end
- print("Tree grew!")
- return true
- end
- function placeSapling()
- turtle.select(2)
- turtle.place()
- turtle.select(1)
- end
- function farm()
- placeSapling()
- waitGrow()
- chopTree()
- dropOff()
- os.sleep(1)
- end
- while true do
- farm()
- end
Advertisement
Add Comment
Please, Sign In to add comment