Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "GenUtil"
- function Continue(h)
- if (h = -1) and turtle.detectUp() then
- return true
- if h > 0 then
- return true
- return false
- end
- function CutUp(h)
- local count = 0
- while Continue(h) do
- turtle.digUp()
- turtle.Up()
- count = count +1
- h = h-1
- end
- return count
- end
- function CutDown(h)
- h = h-1
- while h > 0 do
- turtle.digDown()
- turtle.down()
- h = h-1
- end
- turtle.digDown()
- end
- function CutSpruce()
- turtle.dig()
- turtle.forward()
- local h = CutUp(-1)
- turtle.dig()
- turtle.forward()
- CutDown(h)
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- CutUp(h)
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- CutDown(h)
- end
- function Replant()
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(2)
- turtle.placeDown()
- turtle.forward()
- turtle.placeDown()
- turtle.turnLeft()
- turtle.forward()
- turtle.placeDown()
- turtle.turnLeft()
- turtle.forward()
- turtle.down()
- turtle.forward()
- EmptyForwardReport(3)
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtle.select(1)
- end
- while true do
- local FoundBlock, BlockType = turtle.inspect()
- if FoundBlock then
- if BlockType['name'] == 'minecraft:spruce_log' then
- ReFuel(true)
- CutSpruce()
- Replant()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement