Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chest = peripheral.find("minecraft:ironchest_iron")
- local chest2 = peripheral.find("minecraft:chest")
- local furnace = peripheral.find("minecraft:furnace")
- local bottom = peripheral.wrap("bottom")
- function remove_tree()
- turtle.dig()
- while not turtle.forward() do end
- local i = 1
- local block, infos = turtle.inspectUp()
- while block and infos.name == "minecraft:log" do
- turtle.digUp()
- i = i + 1
- while not turtle.up() do end
- block, infos = turtle.inspectUp()
- end
- for n = 2,i do
- while not turtle.down() do end
- end
- block, infos = turtle.inspectDown()
- if infos.name == "minecraft:log" then
- turtle.digDown()
- turtle.placeDown()
- end
- end
- function clear_rangee()
- for a = 1,6 do
- for b = 1,4 do
- turtle.dig()
- while not turtle.forward() do end
- end
- remove_tree()
- end
- end
- function fill_saplings()
- turtle.select(1)
- n = chest.size()
- while turtle.getItemCount() < 14 and n >= 1 do
- if chest.list()[n] ~= nil and chest.list()[n].name == "minecraft:sapling" then
- chest.pushItems(bottom.getNameLocal(),n,14-turtle.getItemCount())
- end
- n = n - 1
- end
- end
- function send_furnace()
- while furnace.list()[1] ~= nil and furnace.list()[2] ~= nil do
- sleep(1)
- end
- if furnace.list()[3] ~= nil then
- turtle.select(16)
- furnace.pushItems(bottom.getNameLocal(), 3, 64, 16)
- turtle.refuel(64)
- end
- nb = 0
- for i = 1,15 do
- turtle.select(i)
- if turtle.getItemCount() > 0 and turtle.getItemDetail().name ~= "minecraft:log" then
- chest.pullItems(bottom.getNameLocal(), i)
- --turtle.drop()
- else
- nb = nb + turtle.getItemCount()
- if nb > 70 then
- nb = nb - chest2.pullItems(bottom.getNameLocal(), i, nb - 70)
- end
- end
- end
- for i = 1, 15 do
- if nb % 7 ~= 0 then
- nb = nb - chest2.pullItems(bottom.getNameLocal(), i, nb % 7)
- end
- end
- nbn = nb*6/7
- for i = 1,15 do
- if nbn > 0 then
- nbn = nbn - furnace.pullItems(bottom.getNameLocal(),i,nbn,1)
- end
- if nbn == 0 then
- turtle.select(i)
- if turtle.getItemCount() > 0 then
- turtle.transferTo(1, turtle.getItemCount())
- end
- end
- end
- local n = chest2.size()
- while turtle.getItemCount() == 0 do
- if chest2.list()[n] ~= nil and chest2.list()[n].name == "minecraft:crafting_table" then
- chest2.pushItems(bottom.getNameLocal(),n,1,15)
- end
- n = n - 1
- end
- turtle.select(15)
- turtle.equipLeft()
- chest2.pullItems(bottom.getNameLocal(), 15, 1, chest2.size())
- turtle.select(1)
- turtle.craft()
- furnace.pullItems(bottom.getNameLocal(), 1, turtle.getItemCount(), 2)
- chest2.pushItems(bottom.getNameLocal(), chest2.size(), 1, 15)
- turtle.select(15)
- turtle.equipLeft()
- chest2.pullItems(bottom.getNameLocal(), 15, 1, chest2.size())
- end
- --send_furnace()
- function run_turn()
- fill_saplings()
- turtle.dig()
- while not turtle.forward() do end
- turtle.digUp()
- while not turtle.up() do end
- remove_tree()
- clear_rangee()
- turtle.turnRight()
- for i = 1,7 do
- turtle.dig()
- while not turtle.forward() do end
- end
- remove_tree()
- turtle.turnRight()
- clear_rangee()
- turtle.dig()
- while not turtle.forward() do end
- turtle.dig()
- while not turtle.forward() do end
- turtle.turnRight()
- for i = 1,8 do
- turtle.dig()
- while not turtle.forward() do end
- end
- turtle.turnRight()
- turtle.digDown()
- while not turtle.down() do end
- send_furnace()
- end
- run_turn()
Advertisement
Add Comment
Please, Sign In to add comment