KnowThyParadox

SimpleSectorMining

Nov 7th, 2013
270
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. local sectorDimension = 5
  2. local depth = 64
  3.  
  4. for layer = 1, depth do
  5.   for i = 1, sectorDimension do
  6.     for j = 1, sectorDimension do
  7.       if turtle.detectDown() then
  8.         turtle.digDown()
  9.       end
  10.       if j < sectorDimension then
  11.         turtle.forward()
  12.       end
  13.     end
  14.  
  15.     turtle.digDown()
  16.  
  17.     if i == sectorDimension then
  18.       turtle.down()
  19.       turtle.turnRight()
  20.       turtle.turnRight()
  21.  
  22.     elseif i % 2 == 1 then
  23.       turtle.turnRight()
  24.       turtle.forward()
  25.       turtle.turnRight()
  26.  
  27.     else
  28.       turtle.turnLeft()
  29.       turtle.forward()
  30.       turtle.turnLeft()
  31.     end
  32.   end
  33.  
  34.   if layer % 2 == 0 then
  35.     -- Check for inventory full
  36.     local freeInvSpots = 16
  37.     for spot = 1, 16 do
  38.       if turtle.getItemCount( spot ) > 0 then
  39.         freeInvSpots = freeInvSpots - 1
  40.       end
  41.     end
  42.     if freeInvSpots < 4 then
  43.       for depth = 1, layer do
  44.         turtle.up()
  45.       end
  46.      
  47.       turtle.turnLeft()
  48.       for slot = 1, 16 do
  49.          turtle.select( slot )
  50.          turtle.drop( turtle.getItemCount( slot ) )
  51.       end
  52.       turtle.turnRight()
  53.       for depth = 1, layer do
  54.         turtle.down()
  55.       end
  56.     end
  57.   end
  58. end
  59.  
  60. for layer = 1, depth do
  61.   turtle.up()
  62. end
Advertisement
Comments
  • Comment was deleted
Add Comment
Please, Sign In to add comment