Advertisement
cul8ter

clevermine.lua

Apr 7th, 2025
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. local util=dofile("/turtle_utils.lua")
  2. local od=util.dig
  3. util.dig=function()
  4.     local worked,block=turtle.inspect()
  5.     if not worked then return end
  6.     if string.find(block.name,"ore") then
  7.         util.veinmine("ore",true)
  8.     else
  9.         od()
  10.     end
  11. end
  12. local odu=util.digUp
  13. util.digUp=function()
  14.     local worked,block=turtle.inspectUp()
  15.     if not worked then return end
  16.     if sting.find(block.name,"ore") then
  17.         util.veinmine("ore",true)
  18.     else
  19.         odu()
  20.     end
  21. end
  22. local args={...}
  23. if args==nil then
  24.     print("you've gotta tell me how far to tunnel lol")
  25.     return
  26. end
  27. local i=0
  28. for i=1,tonumber(args[1]) do
  29.     if turtle.getFuelLevel()<20 then
  30.         turtle.select(util.find(util.fuel))
  31.         turtle.refuel(64)
  32.     end
  33.     util.dig()
  34.     util.forward(1)
  35.     if not turtle.inspectDown() then
  36.         turtle.select(util.find(util.trash))
  37.         turtle.placeDown()
  38.     end
  39.     turtle.turnLeft()
  40.     for _=1,2 do
  41.         util.dig()
  42.         util.digup()
  43.         turtle.up()
  44.     end
  45.     util.dig()
  46.     util.left(2)
  47.     for _=1,2 do
  48.         util.dig()
  49.         turtle.down()
  50.     end
  51.     util.dig()
  52.     turtle.turnLeft()
  53. end
  54. util.left(2)
  55. util.forward(tonumber(args[1]))
  56. turtle.digDown()
  57. turtle.down()
  58. turtle.digDown()
  59. local slot=util.find(util.trash)
  60. while slot do
  61.     turtle.select(slot)
  62.     turtle.dropDown(64)
  63.     slot=util.find(util.trash)
  64. end
  65. turtle.select(1)
  66. turtle.suckDown(16)
  67. turtle.up()
  68. turtle.placeDown()
  69.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement