Advertisement
HamBrick327

mine.5

Jan 21st, 2022
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.81 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:stone",
  10.     "minecraft:dirt",
  11.     "minecraft:cobblestone",
  12.     "minecraft:sand",
  13.     "minecraft:gravel",
  14.     "minecraft:redstone",
  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. }
  27.  
  28.  
  29. function dropItems()
  30.     print("Purging Inventory...")
  31.     for slot = 1, SLOT_COUNT, 1 do
  32.         local item = t.getItemDetail(slot)
  33.         if(item ~= nil) then
  34.             for filterIndex = 1, #DROPPED_ITEMS, 1 do
  35.                 if(item["name"] == DROPPED_ITEMS[filterIndex]) then
  36.                     print("Dropping - " .. item["name"])
  37.                     t.select(slot)
  38.                     t.dropDown()
  39.                 end
  40.             end
  41.         end
  42.     end
  43. end
  44.  
  45. function checkFuel()
  46.     t.select(1)
  47.  
  48.     if(t.getFuelLevel() < 50) then
  49.         print("Attempting Refuel...")
  50.         for slot = 1, SLOT_COUNT, 1 do
  51.             t.select(slot)
  52.             if(t.refuel(1)) then
  53.                 return true
  54.             end
  55.         end
  56.  
  57.         return false
  58.     else
  59.         return true
  60.     end
  61. end
  62.  
  63. while i < 25 do
  64.     t.dig()
  65.     t.digUp()
  66.     t.digDown()
  67.     t.forward()
  68.     if i == 24 and a then
  69.         t.turnLeft()
  70.         t.dig()
  71.         t.forward()
  72.         t.turnLeft()
  73.         i = 0
  74.         a = false
  75.  
  76.     elseif i == 24 and not a then
  77.         t.turnRight()
  78.         t.dig()
  79.         t.forward()
  80.         t.turnRight()
  81.         i = 0
  82.         a = not a
  83.     end
  84.     checkFuel()
  85.     i = i + 1
  86. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement