Advertisement
giwdul

mining_test

Jan 14th, 2024 (edited)
1,290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | Source Code | 0 0
  1. local function checkFuel()
  2.     if turtle.getFuelLevel() < 10 then
  3.         turtle.select(15)
  4.         turtle.refuel(1)
  5.     end
  6. end
  7.  
  8. local function placeChestAndStoreItems()
  9.     turtle.select(16)
  10.     turtle.placeUp()
  11.     for slot = 1, 14 do
  12.         turtle.select(slot)
  13.         turtle.dropUp()
  14.     end
  15. end
  16.  
  17. local function breakChest()
  18.     turtle.select(16)
  19.     turtle.digUp()
  20. end
  21.  
  22. local function mineTunnel()
  23.   checkFuel()
  24.   for height = 1, 5 do
  25.     if height > 1 then
  26.       turtle.up()
  27.     end
  28.     turtle.dig()
  29.   end
  30.   for height = 1, 4 do
  31.     turtle.down()
  32.   end
  33.   turtle.forward()
  34. end
  35.  
  36. -- Main mining loop
  37. while true do
  38.   mineTunnel()
  39.   if turtle.getItemCount(14) > 0 then
  40.     placeChestAndStoreItems()
  41.     breakChest()
  42.   end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement