Advertisement
maximumrider999

Quarry

Oct 29th, 2019 (edited)
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  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.     tfuel(1000)
  53.     turtle.select(16)
  54.     if turtle.getItemCount() > 0 then
  55.         turnAround()
  56.         turtle.select(chest)
  57.         turtle.place()
  58.         for i = 4, 16 do
  59.             turtle.select(i)
  60.             turtle.drop()
  61.         end
  62.         turnAround()
  63.     end
  64.     turtle.select(1)
  65.     digForward(1)
  66.     turtle.turnLeft()
  67.     digForward(5)
  68.     if j == 3 then
  69.         placeTorch()
  70.     end
  71.     digForward(6)
  72.     if j == 3 then
  73.         placeTorch()
  74.     end
  75.     turtle.turnRight()
  76.     digForward(1)
  77.     turtle.turnRight()
  78.     digForward(11)
  79.     turtle.turnLeft()
  80.     if j == 3 then
  81.         placeTorch()
  82.     end
  83.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement