Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i = 0
- y = 0
- function turnRight(times)
- repeat
- turtle.turnRight()
- i = i + 1
- until i == times
- i = 0
- end
- function forward(times)
- repeat
- turtle.forward()
- i = i + 1
- until i == times
- i = 0
- end
- function itemdrop()
- if y > 0 then
- repeat
- if turtle.down() == true then
- y = y - 1
- else
- turtle.digDown()
- end
- until y == 0
- end
- turnRight(2)
- forward(3)
- i = 1
- repeat
- turtle.select(i)
- items = turtle.getItemCount(i)
- if items > 0 then
- repeat
- turtle.drop()
- items = items - 1
- until items == 0
- end
- i = i + 1
- until i == 16
- i = 0
- turnRight(2)
- forward(3)
- end
- while true do
- if turtle.detect() == true then
- boo, block = turtle.inspect()
- if block.name == "minecraft:log" then
- turtle.dig()
- turtle.digUp()
- turtle.up()
- y = y + 1
- elseif block.name == "minecraft:sapling" then
- fuel = turtle.getFuelLevel()
- if fuel < 50 then
- turnRight(2)
- forward(3)
- turnRight(1)
- forward(1)
- turtle.select(15)
- repeat
- turtle.suckDown()
- turtle.refuel()
- i = i + 1
- until i == 5
- i = 0
- turnRight(2)
- forward(1)
- turnRight(3)
- forward(3)
- end
- sleep(30)
- else
- itemdrop()
- end
- else
- if turtle.detectDown() == false then
- turtle.up()
- repeat
- suc, block = turtle.inspect()
- turtle.dig()
- turtle.digUp()
- turtle.up()
- until suc == false
- repeat
- turtle.down()
- until turtle.detectDown() == true
- y = 0
- itemdrop()
- else
- turtle.select(16)
- turtle.place()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement