Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function stop(m)
- print(m)
- exit()
- end
- function plantTree(slot)
- turtle.select(16)
- turtle.forward()
- treeDetector = turtle.detect()
- turtle.back()
- if not(treeDetector) then
- turtle.place()
- end
- end
- function mineTree(a)
- local blockFront = turtle.detect()
- local tree = 0
- local tree2 = 0
- while blockFront == false do
- blockFront = turtle.detect()
- turtle.forward()
- tree = tree + 1
- if tree == tree2 + 3 then
- tree2 = tree2 + 1
- if blockFront == false then
- local aaa = turtle.detect()
- if not(aaa) then
- plantTree(16)
- end
- end
- end
- end
- if blockFront then
- local blockType, data = turtle.inspect()
- if blockType then
- print(data.name)
- if data.name == "minecraft:log" then
- local i = 0
- while blockFront do
- blockFront = turtle.detect()
- i = i + 1
- turtle.dig()
- turtle.digUp()
- turtle.up()
- end
- while i > 0 do
- i = i - 1
- turtle.down()
- end
- blockFront = turtle.detect()
- end
- if data.name == "minecraft:cobblestone" then
- turtle.turnLeft()
- chestFinder, data = turtle.inspect()
- if chestFinder and data.name == 'minecraft:chest' then
- local i = 1
- turtle.select(1)
- while i <= 15 do
- turtle.select(i)
- i = i + 1
- turtle.drop()
- end
- turtle.select(1)
- end
- turtle.turnLeft()
- end
- if data.name == 'minecraft:sapling' then
- turtle.digUp()
- turtle.up()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- turtle.down()
- end
- if data.name == 'minecraft:coal_block' then
- stop('Coal Block Stop The Machine')
- end
- end
- end
- mineTree()
- end
- mineTree()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement