Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- auto plants and chops 1x1 trees
- place one sapling in slot 14, one bonemeal in slot 15, and one fuel in slot 16
- chest on the right for dumping
- chest on the left for resupplying
- --]]
- running = true
- while running do
- turtle.turnRight()
- for i = 1,13,1 do
- turtle.select(i)
- if not turtle.compareTo(14) and not turtle.compareTo(15) and not turtle.compareTo(16) then
- turtle.drop()
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 4,13,1 do
- turtle.select(i)
- if turtle.getItemSpace(i) == 64 then
- turtle.suck()
- end
- if turtle.compareTo(14) then
- turtle.transferTo(1)
- elseif turtle.compareTo(15) then
- turtle.transferTo(2)
- elseif turtle.compareTo(16) then
- turtle.transferTo(3)
- end
- end
- turtle.turnRight()
- if turtle.getItemCount(1) == 0 then
- print("Out of Saplings")
- print("Stopping")
- running = false
- end
- if turtle.getItemCount(2) == 0 then
- print("Out of Bonemeal")
- print("Stopping")
- running = false
- end
- while turtle.getFuelLevel() <= 20 and turtle.getItemCount(3) >= 1 do
- turtle.select(3)
- turtle.refuel(1)
- end
- if turtle.getFuelLevel() <= 20 then
- print("Out of Fuel")
- print("Stopping")
- running = false
- end
- if running then
- turtle.select(1)
- turtle.place()
- needsBoneMeal = true
- while needsBoneMeal do
- turtle.select(2)
- turtle.place()
- turtle.up()
- if turtle.detect() then
- needsBoneMeal = false
- end
- turtle.down()
- end
- while turtle.detect() do
- turtle.dig()
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement