Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tunnelLength = 10
- buffer = 2
- tunnels = 10
- placeTorches = true
- autoRefuel = true
- trash = {
- dirt = true,
- cobblestone = true,
- gravel = true,
- granite = true,
- andesite = true,
- diorite = true
- }
- desiredOres = {
- "minecraft:coal_ore",
- "minecraft:diamond_ore",
- "minecraft:gold_ore"
- }
- up = true
- local function check()
- for i=2,15 do
- item = turtle.getItemDetail(i)
- if item ~= nil then
- print("Item: "..item.name)
- print(trash[item.name])
- colon = string.find(item.name, ":")
- if trash[string.sub(item.name, colon + 1)] ~= nil and item.count == 16 then
- print("That's trash, throw it out")
- turtle.select(i)
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.drop()
- turtle.turnLeft()
- turtle.turnLeft()
- elseif item.name == "minecraft:coal" and autoRefuel then
- turtle.transferTo(1, turtle.getItemCount(1) - 64)
- if turtle.getFuelLevel() < 50 then
- turtle.select(1)
- turtle.refuel()
- end
- end
- end
- end
- os.setComputerLabel("Fuel: "..turtle.getFuelLevel())
- end
- local function height()
- turtle.dig()
- turtle.digUp()
- turtle.digDown()
- check()
- end
- local function length()
- for i=1,tunnelLength do
- height()
- if i % 5 == 0 and placeTorches then
- turtle.select(16)
- turtle.placeDown()
- turtle.select(2)
- end
- turtle.forward()
- end
- end
- wentLength = true
- local function main()
- for k=1,tunnels do
- length()
- if wentLength then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- for k=1,buffer + 1 do
- height()
- turtle.forward()
- end
- if wentLength then
- turtle.turnLeft()
- wentLength = false
- else
- turtle.turnRight()
- wentLength = true
- end
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement