Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- depth = 150
- valuable = {"minecraft:torch", "minecraft:diamond", "minecraft:iron_ore", "minecraft:lapis_lazuli", "minecraft:coal", "minecraft:gold_ore", "minecraft:redstone"}
- garbage_interval = 30
- torch_interval = 16
- torch_slot = 2
- function emptyIntoChest()
- for i = 1, 16 do
- turtle.select(i)
- turtle.drop()
- end
- end
- function deleteGarbage()
- for i = 1,16 do
- turtle.select(i)
- data = turtle.getItemDetail()
- if data ~= nil then
- name = data["name"]
- keep = true
- if keep == false then
- turtle.dropDown()
- print("dropping item" .. name)
- end
- end
- end
- end
- function placeTorch()
- turtle.down()
- turtle.select(torch_slot)
- turtle.back()
- turtle.back()
- turtle.place()
- turtle.up()
- turtle.forward()
- turtle.forward()
- end
- if turtle.getFuelLevel() < 350 then
- turtle.select(1)
- turtle.refuel()
- end
- if turtle.getFuelLevel() < 350 then
- print("refuel not succesful")
- error()
- end
- function checkTorches()
- turtle.select(torch_slot)
- torch_count = turtle.getItemCount()
- if torch_count < depth/torch_interval then
- print("not enough torches")
- end
- end
- for a=1,depth do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- if a%garbage_interval == 0 then
- deleteGarbage()
- end
- if a%torch_interval == 0 then
- placeTorch()
- end
- end
- for a=1, depth do
- turtle.back()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- if turtle.detect() then
- -- chest exists
- print("chest found")
- emptyIntoChest()
- end
- print(tostring(turtle.getFuelLevel()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement