Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("How many trees shall I grow?")
- trees= read()
- turtle.select(1)
- function chopTree()
- turtle.select(3)
- repeat
- turtle.detect()
- until turtle.compare()
- turtle.select(1)
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- while not(turtle.detectDown()) do
- turtle.down()
- end
- turtle.back()
- end
- function plantTree()
- turtle.select(1)
- turtle.place()
- turtle.select(2)
- turtle.place()
- end
- function dropLogs()
- turtle.turnLeft()
- turtle.turnLeft()
- for inv=3, 9 do
- turtle.select(inv)
- turtle.drop(64)
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- for l=1, trees do
- plantTree()
- chopTree()
- dropLogs()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement