Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function sapling()
- turtle.suckDown()
- turtle.select(1)
- turtle.placeDown()
- end
- while true do
- local success, data = turtle.inspect()
- if data.name == "minecraft:spruce_log" then
- turtle.suckUp()
- turtle.down()
- turtle.back()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.down()
- for i = 1, 5 do
- turtle.suckDown()
- end
- turtle.up()
- turtle.back()
- turtle.back()
- turtle.turnRight()
- turtle.forward()
- turtle.up()
- local side = 0
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- turtle.digUp()
- turtle.up()
- side = side + 1
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- side = side%4
- if side == 1 then
- turtle.turnRight()
- turtle.back()
- elseif side == 2 then
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- elseif side == 3 then
- turtle.forward()
- turtle.turnLeft()
- end
- turtle.up()
- sapling()
- turtle.forward()
- sapling()
- turtle.turnLeft()
- turtle.forward()
- sapling()
- turtle.turnLeft()
- turtle.forward()
- sapling()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.down()
- while turtle.getFuelLevel() < 250 do
- print('refueling...')
- for slot = 2, 16 do
- local item = turtle.getItemDetail(slot)
- if item and item.name == 'minecraft:spruce_log' then
- turtle.select(slot)
- turtle.refuel()
- break
- end
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for slot = 2, 16 do
- turtle.select(slot)
- turtle.drop()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
- os.sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement