Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local treesToCut = 100
- function autoRefuel()
- if turtle.getFuelLevel() < 80 then
- turtle.select(16)
- while turtle.getFuelLevel() < 80 do
- turtle.refuel(1)
- end
- turtle.select(1)
- end
- end
- for i=1, treesToCut do
- autoRefuel()
- -- replenish missing materials
- -- wood for fuel
- turtle.select(16)
- turtle.suckDown(64-turtle.getItemCount(16))
- -- bonemeal
- turtle.turnRight()
- turtle.forward()
- turtle.select(14)
- turtle.suckDown(64-turtle.getItemCount(14))
- -- saplings
- turtle.forward()
- turtle.select(15)
- turtle.suckDown(64-turtle.getItemCount(15))
- turtle.select(1)
- -- go back
- turtle.back()
- turtle.back()
- turtle.turnLeft()
- -- place sapling
- turtle.select(15)
- turtle.place()
- -- bonemeal sapling
- turtle.select(14)
- while turtle.place() do
- end
- turtle.select(1)
- -- cut tree
- while turtle.detect() do
- turtle.dig()
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- for j=1,12 do
- turtle.select(j)
- turtle.dropDown()
- end
- turtle.select(1)
- end
- -- repeat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement