Advertisement
HamBrick327

mine7

Jun 23rd, 2022 (edited)
876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.68 KB | None | 0 0
  1. local t = turtle
  2.  
  3. local i = 0
  4. local q = 0
  5. local a = true
  6. local SLOT_COUNT = 16
  7.  
  8. DROPPED_ITEMS = {
  9.     "minecraft:tuff",
  10.     "minecraft:stone",
  11.     "minecraft:dirt",
  12.     "minecraft:cobblestone",
  13.     "minecraft:sand",
  14.     "minecraft:gravel",
  15.     "minecraft:flint",
  16.     "railcraft:ore_metal",
  17.     "extrautils2:ingredients",
  18.     "minecraft:dye",
  19.     "thaumcraft:nugget",
  20.     "thaumcraft:crystal_essence",
  21.     "thermalfoundation:material",
  22.     "projectred-core:resource_item",
  23.     "thaumcraft:ore_cinnabar",
  24.     "deepresonance:resonating_ore",
  25.     "forestry:apatite",
  26.     "create:granite_cobblestone",
  27.     "create:diorite_cobblestone",
  28.     "create:andesite_cobblestone",
  29.     "thermal:niter",
  30.     "minecraft:netherrack",
  31.     "minecraft:blackstone",
  32.     "extcaves:lavastone",
  33.     "forbidden_arcanus:darkstone",
  34.     "create:raw_zinc",
  35.     "minecraft:raw_copper",
  36.     "mekanism:raw_lead",
  37.     "minecraft:cobbled_deepslate"
  38. }
  39.  
  40. function mineAround()
  41.     isBlock, data = t.inspect()
  42.     if (isBlock) then
  43.         if (data['name'] == 'forbidden_arcanus:stella_arcanum') then
  44.             t.turnLeft()
  45.             if (t.detect()) then
  46.                 t.turnRight()
  47.                 t.turnRight()
  48.                 t.dig()
  49.                 t.forward()
  50.                 t.turnLeft()
  51.                 t.dig()
  52.                 t.forward()
  53.                 t.dig()
  54.                 t.forward()
  55.                 t.turnLeft()
  56.                 t.dig()
  57.                 t.forward()
  58.                 t.turnRight()
  59.             else
  60.                 t.forward()
  61.                 t.turnRight()
  62.                 t.forward()
  63.                 t.forward()
  64.                 t.turnRight()
  65.                 t.dig()
  66.                 t.forward()
  67.                 t.turnLeft()
  68.             end
  69.  
  70.        end
  71.     end
  72.         isBlock, data = t.inspectDown()
  73.     if (isBlock) then
  74.         if (data['name'] == 'forbidden_arcanus:stella_arcanum') then
  75.             t.turnLeft()
  76.             if (t.detect()) then
  77.                 t.turnRight()
  78.                 t.turnRight()
  79.                 t.dig()
  80.                 t.forward()
  81.                 t.turnLeft()
  82.                 t.dig()
  83.                 t.forward()
  84.                 t.dig()
  85.                 t.forward()
  86.                 t.turnLeft()
  87.                 t.dig()
  88.                 t.forward()
  89.                 t.turnRight()
  90.             else
  91.                 t.forward()
  92.                 t.turnRight()
  93.                 t.forward()
  94.                 t.forward()
  95.                 t.turnRight()
  96.                 t.dig()
  97.                 t.forward()
  98.                 t.turnLeft()
  99.           end
  100.        end
  101.     end
  102.         isBlock, data = t.inspectUp()
  103.     if (isBlock) then
  104.         if (data['name'] == 'forbidden_arcanus:stella_arcanum') then
  105.             t.turnLeft()
  106.             if (t.detect()) then
  107.                 t.turnRight()
  108.                 t.turnRight()
  109.                 t.dig()
  110.                 t.forward()
  111.                 t.turnLeft()
  112.                 t.dig()
  113.                 t.forward()
  114.                 t.dig()
  115.                 t.forward()
  116.                 t.turnLeft()
  117.                 t.dig()
  118.                 t.forward()
  119.                 t.turnRight()
  120.             else
  121.                 t.forward()
  122.                 t.turnRight()
  123.                 t.forward()
  124.                 t.forward()
  125.                 t.turnRight()
  126.                 t.dig()
  127.                 t.forward()
  128.                 t.turnLeft()
  129.             end
  130.            
  131.        end
  132.     end
  133. end
  134.    
  135. function dropItems()
  136.     print("Purging Inventory...")
  137.     for slot = 1, SLOT_COUNT, 1 do
  138.         local item = t.getItemDetail(slot)
  139.         if(item ~= nil) then
  140.             for filterIndex = 1, #DROPPED_ITEMS, 1 do
  141.                 if(item["name"] == DROPPED_ITEMS[filterIndex]) then
  142.                     print("Dropping - " .. item["name"])
  143.                     t.select(slot)
  144.                     t.dropDown()
  145.                 end
  146.             end
  147.         end
  148.     end
  149.     t.select(1)
  150. end
  151.  
  152. function checkFuel()
  153.     t.select(1)
  154.  
  155.     if(t.getFuelLevel() < 50) then
  156.         print("Attempting Refuel...")
  157.         for slot = 1, SLOT_COUNT, 1 do
  158.             t.select(slot)
  159.             if(t.refuel(1)) then
  160.                 return true
  161.             end
  162.         end
  163.  
  164.         return false
  165.     else
  166.         return true
  167.     end
  168. end
  169.  
  170. while i < 25 do
  171.     mineAround()
  172.     t.dig()
  173.     t.digUp()
  174.     t.digDown()
  175.     t.forward()
  176.     if i == 24 and a then
  177.         t.turnLeft()
  178.         t.dig()
  179.         t.forward()
  180.         t.turnLeft()
  181.         i = 0
  182.         a = false
  183.  
  184.     elseif i == 24 and not a then
  185.         t.turnRight()
  186.         t.dig()
  187.         t.forward()
  188.         t.turnRight()
  189.         i = 0
  190.         a = not a
  191.     end
  192.     checkFuel()
  193.     dropItems()
  194.     i = i + 1
  195. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement