Advertisement
maximumrider999

Quarry 2

Mar 31st, 2023 (edited)
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Quarry a function by Maximumrider999
  2.  
  3. --Vars
  4. local tArgs = {...}
  5. local loops = tonumber(tArgs[1])
  6. local torch = 2
  7. local fuel = 1
  8. local chest = 3
  9. local j = 0
  10.  
  11. --Functions
  12.  
  13. function tfuel(amount)
  14.     if turtle.getFuelLevel() < amount then do
  15.         turtle.select(fuel)
  16.         turtle.refuel()
  17.     end
  18. end
  19. end
  20.  
  21. function digForward(amount)
  22.     if  amount < 1 then
  23.         amount = 1
  24.     end
  25.     for i = 1, amount do
  26.         while turtle.detect() == true do
  27.             turtle.dig()
  28.         end
  29.         turtle.forward()
  30.         turtle.digUp()
  31.         turtle.digDown()
  32.     end
  33. end
  34.    
  35. function placeTorch()
  36.     turtle.select(torch)
  37.     turtle.placeDown()
  38. end
  39.  
  40. function turnAround()
  41.     turtle.turnLeft()
  42.     turtle.turnLeft()
  43. end
  44.  
  45. --Main
  46.  for i = 0, loops do
  47.     if j == 3 then
  48.         j = 0
  49.     else
  50.         j = j + 1
  51.     end
  52.     for k = 0,2 do
  53.         tfuel(1000)
  54.         turtle.select(16)
  55.         if turtle.getItemCount() > 0 then
  56.             turnAround()
  57.             turtle.select(chest)
  58.             turtle.place()
  59.             for i = 4, 16 do
  60.                 turtle.select(i)
  61.                 turtle.drop()
  62.             end
  63.             turnAround()
  64.         end
  65.         turtle.select(1)
  66.         digForward(1)
  67.         turtle.turnLeft()
  68.         digForward(5)
  69.         if j == 3 and k == 0 then
  70.             placeTorch()
  71.         end
  72.         digForward(6)
  73.         if j == 3 and k == 0 then
  74.             placeTorch()
  75.         end
  76.         turtle.turnRight()
  77.         digForward(1)
  78.         turtle.turnRight()
  79.         digForward(11)
  80.         turtle.turnLeft()
  81.         if j == 3 and k == 0 then
  82.             placeTorch()
  83.         end
  84.         if k ~= 2 then
  85.             turtle.back()
  86.             turtle.back()
  87.             turtle.up()
  88.             turtle.digUp()
  89.             turtle.up()
  90.             turtle.digUp()
  91.             turtle.up()
  92.         end
  93.     end
  94.     turtle.down()
  95.     turtle.down()
  96.     turtle.down()
  97.     turtle.down()
  98.     turtle.down()
  99.     turtle.down()
  100.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement