SHARE
TWEET

Untitled

a guest Feb 14th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local args = {...}
  2.  
  3. if not #args == 1 then
  4.   print("Usage: hole <radius>")
  5.   print("Place chest/s in slot 16 (will be automatically placed and filled when inventory is full)")
  6.   return
  7. end
  8.  
  9. local radius = tonumber(args[1])
  10.  
  11. function checkFuel()
  12.     while turtle.getFuelLevel() < 10 do
  13.         print("Error: Low fuel")
  14.         for i=1,15 do
  15.             turtle.select(i)
  16.             turtle.refuel()
  17.         end
  18.         sleep(1)
  19.     end
  20. end
  21.  
  22. function checkInv()
  23.   isFull = true
  24.  
  25.   for i=1,15 do
  26.     if turtle.getItemCount(i) == 0 then
  27.       isFull = false
  28.     end
  29.   end
  30.  
  31.   if isFull == true then
  32.     turtle.select(16)
  33.     while not turtle.placeUp() do turtle.digUp() end
  34.     for i=1,15 do
  35.       turtle.select(i)
  36.       turtle.dropUp()
  37.     end
  38.   end
  39. end
  40.  
  41. function digToHellAndBack()
  42.     for z=0,43 do
  43.    
  44.         local success, data = turtle.inspectDown()
  45.         if success then
  46.             print("Block name: ", data.name)
  47.             print("Block metadata: ", data.metadata)
  48.             if data.name == "minecraft:bedrock" then
  49.                 break
  50.             end
  51.         end
  52.    
  53.         turtle.digDown()
  54.         while not turtle.down() do sleep(0.1) end
  55.     end
  56.     for z=0,43 do
  57.         while not turtle.up() do sleep(0.1) end
  58.     end
  59. end
  60.  
  61.  
  62. for i=0,1024 do
  63.     if i > radius then
  64.         break
  65.     end
  66.    
  67.     for j=0,1 do
  68.         for j=0,1024 do
  69.             if j > i then
  70.                 break
  71.             end
  72.             checkFuel()
  73.             checkInv()
  74.             digToHellAndBack()
  75.             turtle.dig()
  76.             while not turtle.forward() do sleep(0.1) end
  77.         end
  78.         turtle.turnRight()
  79.     end
  80. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top