Advertisement
HNO3

Simple mining Drill

Mar 16th, 2016
1,272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- pastebin get jZp85wb7 drill
  2. -- pastebin run jZp85wb7
  3. function dig()
  4.     return turtle.dig()
  5. end
  6.  
  7. local firsthit = false
  8. local fill = 0
  9. local drill=true
  10. local depth=0
  11. while drill do
  12.     temp, data = turtle.inspectDown()
  13.     if data.name == "minecraft:bedrock" then
  14.         for i=0,depth-1 do
  15.             turtle.up()
  16.             if i >= (depth - (fill+2)) then
  17.                 turtle.select(2)
  18.                 turtle.placeDown()
  19.             end
  20.         end
  21.         drill = false
  22.         for k=2,16 do
  23.             turtle.select(k)
  24.             turtle.drop()
  25.         end
  26.     else
  27.         if not turtle.detectDown() then
  28.             if not firsthit then
  29.                 firsthit=true
  30.                 fill = depth + 1
  31.             end
  32.         end
  33.         turtle.digDown()
  34.         if turtle.down() then depth = depth + 1 end
  35.         for j=1,4 do
  36.             temp, block = turtle.inspect()
  37.             if block.name == "minecraft:obsidian" then dig()
  38.             elseif block.name == "minecraft:diamond_ore" then dig()
  39.             elseif block.name == "minecraft:diamond_block" then dig()
  40.             elseif block.name == "minecraft:redstone_ore" then dig()
  41.             elseif block.name == "minecraft:lit_redstone_ore" then dig()
  42.             elseif block.name == "minecraft:emerald_ore" then dig()
  43.             elseif block.name == "minecraft:emerald_block" then dig()
  44.             elseif block.name == "minecraft:gold_ore" then dig()
  45.             elseif block.name == "minecraft:iron_ore" then dig()
  46.             elseif block.name == "minecraft:coal_ore" then dig()
  47.             elseif block.name == "minecraft:redstone_block" then dig()
  48.             elseif block.name == "minecraft:quartz_ore" then dig()
  49.             elseif block.name == "minecraft:quartz_block" then dig()
  50.             elseif block.name == "minecraft:diamond_block" then dig()
  51.             elseif block.name == "BiomesOPlenty:gemOre" then dig()
  52.             elseif block.name == "IC2:blockOreCopper" then dig()
  53.             elseif block.name == "IC2:blockOreTin" then dig()
  54.             elseif block.name == "IC2:blockOreUran" then dig()
  55.             elseif block.name == "IC2:blockOreLead" then dig()
  56.             elseif block.name == "TConstruct:SeardBrick" then dig()
  57.             elseif block.name == "TConstruct:GravelOre" then dig()
  58.             elseif block.name == "UndergroundBiomes:igneous_oreRedstone" then dig()
  59.             elseif block.name == "UndergroundBiomes:metamorphic_oreRedstone" then dig()
  60.             elseif block.name == "UndergroundBiomes:sedimentary_oreRedstone" then dig()
  61.             elseif block.name == "UndergroundBiomes:igneous_oreCoal" then dig()
  62.             elseif block.name == "UndergroundBiomes:metamorphic_oreCoal" then dig()
  63.             elseif block.name == "UndergroundBiomes:sedimentary_oreCoal" then dig()
  64.             elseif block.name == "UndergroundBiomes:igneous_oreDiamond" then dig()
  65.             elseif block.name == "UndergroundBiomes:metamorphic_oreDiamond" then dig()
  66.             elseif block.name == "UndergroundBiomes:sedimentary_oreDiamond" then dig()
  67.             elseif block.name == "UndergroundBiomes:igneous_oreLapis" then dig()
  68.             elseif block.name == "UndergroundBiomes:metamorphic_oreLapis" then dig()
  69.             elseif block.name == "UndergroundBiomes:sedimentary_oreLapis" then dig()
  70.             elseif block.name == "UndergroundBiomes:igneous_oreEmerald" then dig()
  71.             elseif block.name == "UndergroundBiomes:metamorphic_oreEmerald" then dig()
  72.             elseif block.name == "UndergroundBiomes:sedimentary_oreEmerald" then dig()
  73.             elseif block.name == "UndergroundBiomes:igneous_oreGold" then dig()
  74.             elseif block.name == "UndergroundBiomes:metamorphic_oreGold" then dig()
  75.             elseif block.name == "UndergroundBiomes:sedimentary_oreGold" then dig()
  76.             elseif block.name == "UndergroundBiomes:igneous_oreIron" then dig()
  77.             elseif block.name == "UndergroundBiomes:metamorphic_oreIron" then dig()
  78.             elseif block.name == "UndergroundBiomes:sedimentary_oreIron" then dig()
  79.             elseif block.name == "harvestcraft:salt" then dig()
  80.             elseif block.name == "appliedenergistics2:tile.OreQuartz" then dig()
  81.             elseif block.name == "appliedenergistics2:tile.OreQuartzCharged" then dig()
  82.             end
  83.             turtle.turnLeft()
  84.         end
  85.     end
  86. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement