Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tHeight = 8
- local number = 22
- local Height = 0
- local function sel(item)
- for i=1,16 do
- if turtle.getItemCount(i) > 0 and turtle.getItemDetail(i).name == item then
- turtle.select(i)
- return true
- end
- end
- return false
- end
- function b()
- local a,c = turtle.inspect()
- if a then
- return c.name
- else
- return "minecraft:air"
- end
- end
- local function check()
- if Height % tHeight == 0 then
- if b() ~= "minecraft:dirt" then
- turtle.dig()
- sel("minecraft:dirt")
- turtle.place()
- turtle.select(1)
- end
- elseif Height % tHeight ==1 then
- if b() ~= "minecraft:sapling" then
- turtle.dig()
- sel("minecraft:sapling")
- turtle.place()
- turtle.select(1)
- end
- else
- turtle.dig()
- end
- end
- turtle.select(1)
- while Height < tHeight * number do
- check()
- repeat
- turtle.digUp()
- until turtle.up()
- Height = Height + 1
- end
- check()
- while Height > 0 do
- repeat
- turtle.digDown()
- until turtle.down()
- Height = Height - 1
- check()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement