Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local util={}
- util.find=function(name)
- for i=1,16 do
- local item=turtle.getItemDetail(i)
- if item and ((type(name)=="table" and name[item.name]) or item.name==name) then
- return i
- end
- end
- end
- util.dig=function()
- local worked,block=turtle.inspect()
- while worked and block~="mythicmetals:unobtainium_ore" do
- turtle.dig()
- os.sleep(0.2)
- worked,block=turtle.inspect()
- end
- end
- util.left=function(i)
- for _=1,i do
- turtle.turnLeft()
- end
- end
- util.right=function(i)
- for _=1,i do
- turtle.turnRight()
- end
- end
- util.forward=function(i)
- for _=1,i do
- turtle.forward()
- end
- end
- util.back=function(i)
- for _=1,i do
- turtle.back()
- end
- end
- util.digup=function()
- local worked,block=turtle.inspectUp()
- while worked and block~="mythicmetals:unobtainium_ore" do
- turtle.digUp()
- os.sleep(0.2)
- worked,block=turtle.inspect()
- end
- end
- util.up=function(i)
- for _=1,i do
- turtle.up()
- end
- end
- util.down=function(i)
- for _=1,i do
- turtle.down()
- end
- end
- function checkFront(blockName,fuzzy)
- worked,block=turtle.inspect()
- if worked and (
- block.name==blockName or (
- fuzzy and string.find(
- block.name,blockName
- )
- )
- ) then
- turtle.dig()
- turtle.forward()
- spin(blockName,fuzzy)
- turtle.back()
- end
- end
- function checkDown(blockName,fuzzy)
- worked,block=turtle.inspectDown()
- if worked and (
- block.name==blockName or (
- fuzzy and string.find(
- block.name,blockName
- )
- )
- ) then
- turtle.digDown()
- turtle.down()
- spin(blockName,fuzzy)
- turtle.up()
- end
- end
- function checkUp(blockName,fuzzy)
- worked,block=turtle.inspectUp()
- if worked and (
- block.name==blockName or (
- fuzzy and string.find(
- block.name,blockName
- )
- )
- ) then
- turtle.digUp()
- turtle.up()
- spin(blockName,fuzzy)
- turtle.down()
- end
- end
- function spin(blockName,fuzzy)
- checkDown(blockName,fuzzy)
- for _=1,4 do
- checkFront(blockName,fuzzy)
- turtle.turnLeft()
- end
- checkUp(blockName,fuzzy)
- end
- util.veinmine=spin
- util.fuel={}
- util.fuel["minecraft:coal"]=true
- util.fuel["minecraft:charcoal"]=true
- util.fuel["minecraft:oak_planks"]=true
- util.fuel["modern_industrialization:lignite_coal"]=true
- util.fuel["mythicmetals:morkite"]=true
- util.trash={}
- util.trash["minecraft:cobbled_deepslate"]=true
- util.trash["minecraft:cobblestone"]=true
- util.trash["minecraft:tuff"]=true
- return util
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement