Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local saplings = 1 -- the slot where the saplings are
- turtle.select(saplings) -- select the saplings
- while true do
- turtle.turnLeft()
- turtle.suck()
- turtle.turnRight()
- turtle.select(2)
- turtle.drop()
- turtle.select(saplings)
- if turtle.getFuelLevel() < 4000
- then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(9)
- turtle.suck()
- turtle.refuel(64)
- turtle.select(saplings)
- turtle.turnRight()
- turtle.turnRight()
- end
- for i = 1, 9 do -- plant 8 saplings in a row
- turtle.turnRight()
- if not turtle.compare() then -- if not a sapling, then a tree grew
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do -- dig tree out
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectDown() do -- back down to ground
- turtle.down()
- end
- turtle.back()
- turtle.place() -- put down new sapling
- end
- turtle.turnLeft()
- turtle.forward()
- end
- -- turn around and line up for next pass
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.turnLeft()
- os.sleep(30) -- sleep for 30 seconds to allow trees to grow
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement