Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --defines how many tree to harvest
- local times = 0
- term.write("Number of trees to cut: ")
- times = read()
- for u = 1, times do
- -- sets a vari for use when cutting the tree
- local x = 0
- --fueles the turtle
- function checkFuel()
- if turtle.getFuelLevel() <= 10 --or any number, depending on how frequently you check, and how much the turtle moves.
- turtle.select(1) --fuel goes in this slot
- turtle.refuel(1)
- turtle.select(2) --use any slot here, I default to 2, depending on the program.
- end
- end
- --plants and bonemeals the tree
- turtle.select(2)
- turtle.place()
- turtle.select(3)
- turtle.place()
- turtle.place()
- turtle.place()
- -- moves the turtle up
- while turtle.detect() do
- turtle.digUp()
- turtle.up()
- x = x+1
- end
- --moves the turlte over the log
- turtle.forward()
- --cuts the tree and moves down depending on the vari x
- for i = 1, x do
- turtle.digDown()
- turtle.down()
- end
- -- sets vari x to 0
- x = 0
- -- moves turtle over to chest and turns it around
- turtle.back()
- turtle.turnLeft()
- turtle.turnLeft()
- -- puts any tree and saplings into the chest
- turtle.select(4)
- turtle.drop()
- turtle.select(5)
- turtle.drop()
- turtle.select(2)
- -- turns the turtle around to the start position
- turtle.turnLeft()
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment