Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local blocksToMine = {"minecraft:gold_ore", "minecraft:iron_ore", "minecraft:diamond_ore", "minecraft:lapis_ore", "minecraft:emerald_ore", "minecraft:coal_ore", "minecraft:gold_ore"}
- local currentMine = 1
- local stripMines
- local function tableContains (tab, val)
- for index, value in ipairs(tab) do
- if value == val then
- return true
- end
- end
- return false
- end
- function unload()
- local suc, data = turtle.inspect()
- local itemDet
- if data["name"] == "minecraft:chest" then
- for i=1, 16, 1 do
- turtle.select(i)
- itemDet = turtle.getItemDetail()
- if itemDet["ID"] == "minecraft:coal" && turtle.getFuelLevel() < turtle.getFuelLimit() then
- turtle.refuel()
- end
- if turtle.drop() == false then
- print("ERROR: Could not unload - Chest is full!")
- end
- end
- else
- print("ERROR: Could not unload - Chest not found!")
- return
- end
- end
- function forward(table)
- table[table.length + 1] = "fwd"
- turtle.forward()
- end
- function left()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- end
- function stripMine()
- local noOre = true
- stripMines[currentMine] = 0
- while noOre do
- stripMines[currentMine] = stripMines[currentMine] + 1
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- local check = checkArea()
- if tableContains(check, true) then
- mineVien
- end
- end
- end
- function mineVien(block)
- local area = checkAreaB(block)
- local path = {}
- for i=1, 5, 1 do
- if area[i] == fwd then
- turtle.dig()
- turtle.forward()
- path[] = "fwd"
- elseif area[i] == dwn then
- turtle.digDown()
- turtle.down()
- elseif area[i] == lft then
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- elseif area[i] == rgt then
- elseif area[i] == up then
- end
- end
- end
- function checkArea()
- local fsuccess, fdata = turtle.inspect()
- print("Inspected Forward")
- local usuccess, udata = turtle.inspectUp()
- print("Inspected Up")
- local dsuccess, ddata = turtle.inspectDown()
- print("Inspected Down")
- turtle.turnLeft()
- local lsuccess, ldata = turtle.inspect()
- print("Inspected Left")
- turtle.turnRight()
- turtle.turnRight()
- local rsuccess, rdata = turtle.inspect()
- print("Inspected Right")
- turtle.turnLeft()
- local up[1],dwn[1],lft[1],rgt[1],fwd[1] = false
- if tableContains(blocksToMine, fdata["name"]) == true then
- fwr[1] = true
- fwr[2] = fdata["name"]
- end
- if tableContains(blocksToMine, udata["name"]) == true then
- up[1] = true
- up[2] = udata["name"]
- end
- if tableContains(blocksToMine, ddata["name"]) == true then
- dwn[1] = true
- dwn[2] = ddata["name"]
- end
- if tableContains(blocksToMine, ldata["name"]) == true then
- lft[1] = true
- lft[2] = ldata["name"]
- end
- if tableContains(blocksToMine, rdata["name"]) == true then
- rgt[1] = true
- rgt[2] = rdata["name"]
- end
- return up,dwn,lft,rgt,fwd
- end
- function checkAreaB(block)
- local fsuccess, fdata = turtle.inspect()
- print("Inspected Forward")
- local usuccess, udata = turtle.inspectUp()
- print("Inspected Up")
- local dsuccess, ddata = turtle.inspectDown()
- print("Inspected Down")
- turtle.turnLeft()
- local lsuccess, ldata = turtle.inspect()
- print("Inspected Left")
- turtle.turnRight()
- turtle.turnRight()
- local rsuccess, rdata = turtle.inspect()
- print("Inspected Right")
- turtle.turnLeft()
- local up,dwn,lft,rgt,fwd = false
- if fdata["name"] == block then
- fwr = true
- end
- if udata["name"] == block then
- up = true
- end
- if ddata["name"] == block then
- dwn = true
- end
- if ldata["name"] == block then
- lft = true
- end
- if rdata["name"] == block then
- rgt = true
- end
- return up,dwn,lft,rgt,fwd
- end
- print(checkArea())
Add Comment
Please, Sign In to add comment