TheMudkip

ManChunks

Aug 28th, 2022
1,410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.76 KB | None | 0 0
  1. --1 Chunk Manual
  2. local l = 0
  3. local z = 0
  4. function fuelcheck(y)
  5.     local level = turtle.getFuelLevel()
  6.     if (level < 256*y+16)
  7.     then
  8.       write("There is not enough fuel")
  9.       os.shutdown()
  10.     else
  11.       write("There will be "..level - 256*y.." fuel left")
  12.     end
  13. end
  14.  
  15. function layer()
  16.     turtle.digDown()
  17.     turtle.down()
  18.     z = z + 1
  19.     for i = 1, w, 1 do
  20.         for e = 1, p, 1 do
  21.             turtle.dig()
  22.             turtle.forward()
  23.         end
  24.     if(i ~= 16)
  25.         then
  26.             if(i % 2 == 0)
  27.             then
  28.             turtle.turnLeft()
  29.             turtle.dig()
  30.             turtle.forward()
  31.             turtle.turnLeft()
  32.             else
  33.             turtle.turnRight()
  34.             turtle.dig()
  35.             turtle.forward()
  36.             turtle.turnRight()
  37.             end
  38.         else
  39.             turtle.turnRight()
  40.         end
  41.     end
  42.  
  43.  
  44. end
  45.  
  46.  
  47. function initialchestDeposit()
  48. turtle.select(1)
  49. turtle.placeUp()
  50.     local s = 1
  51.         for i = 1, 15, 1 do
  52.             s = s + 1
  53.             turtle.select(s)
  54.             turtle.dropUp()
  55.         end
  56. end
  57.  
  58. function invCheck()
  59.     local s = 1
  60.     for i = 1, 15, 1 do
  61.         s = s + 1
  62.         turtle.select(s)
  63.         local data = turtle.getItemDetail()
  64.         if data
  65.             then
  66.             turtle.down()
  67.             deposit()
  68.             l = l - 1
  69.         end
  70.     end
  71. end
  72.  
  73. function chestDeposit()
  74.     l = 0
  75.     for i = 1, z - 1, 1 do
  76.         turtle.up()
  77.         l = l + 1
  78.     end
  79.     local s = 1
  80.     for i = 1, 15, 1 do
  81.         s = s + 1
  82.         turtle.select(s)
  83.         turtle.dropUp()
  84.     end
  85.     invCheck()
  86.     for i = 1, l, 1 do
  87.         turtle.down()
  88.     end
  89. end
  90.  
  91.  
  92.  
  93.  
  94. function deposit()
  95.     turtle.select(1)
  96.     turtle.placeUp()
  97.     local s = 1
  98.         for i = 1, 15, 1 do
  99.             s = s + 1
  100.             turtle.select(s)
  101.             turtle.dropUp()
  102.         end  
  103. end
  104.  
  105. function lavaFuel()
  106.     turtle.select(2)
  107.     turtle.placeUp()
  108.     turtle.select(3)
  109.     turtle.suckUp()
  110.     turtle.refuel()
  111.     turtle.dropUp()
  112.     sleep()
  113.     turtle.suckUp()
  114.     turtle.refuel()
  115.     turtle.dropUp()
  116.     turtle.select(2)
  117.     turtle.digUp()
  118.     turtle.select(1)
  119. end
  120.  
  121. function startPosition()    
  122.         for i = 1, 15, 1 do
  123.             turtle.forward()
  124.         end
  125.     turtle.turnRight()
  126. end
  127.  
  128. function chunk(y)
  129.     for i = 1, y, 1 do
  130.         layer()
  131.         startPosition()
  132.         print(z)
  133.         if (z == 1)
  134.         then
  135.             initialchestDeposit()
  136.         else
  137.             chestDeposit()
  138.         end
  139.     end
  140. end
  141.  
  142. write("How Many Layers to Remove?")
  143. local y = read()
  144. local x = y
  145. write("Width")
  146. local w = read()
  147. write("Length")
  148. local p = read()
  149. fuelcheck(y)
  150. print("Removing "..y.." Layers ...")
  151. chunk(y)
Advertisement
Add Comment
Please, Sign In to add comment