Guest User

chunkmine

a guest
Mar 15th, 2020
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. local height = {...}[1]
  2. function checkEC()
  3.   local dump = false
  4.   for i=3,16,1 do
  5.     turtle.select(i)
  6.     if turtle.getItemCount() > 16 then
  7.       dump = true
  8.     end
  9.     if i == 16 && turtle.getItemCount() > 0 then
  10.       dump = true
  11.     end
  12.   end
  13.   if dump == true then
  14.     turtle.select(1)
  15.     turtle.digUp()
  16.     turtle.placeUp()
  17.     for i=3,16,1 do
  18.       turtle.select(i)
  19.       turtle.dropUp()
  20.     end
  21.     turtle.select(1)
  22.     turtle.mineUp()
  23.   end
  24.   if turtle.getFuelLevel() < 1000 then
  25.     turtle.digUp()
  26.     turtle.select(2)
  27.     turtle.placeUp()
  28.     turtle.suckUp()
  29.     turtle.refuel()
  30.     turtle.digUp()
  31.   end
  32. end
  33.  
  34. function mine()
  35.   checkEC()
  36.   while turtle.detect() do
  37.     turtle.dig()
  38.   end
  39. end
  40.  
  41. function move()
  42.   while turtle.detect() do
  43.     mine()
  44.   end
  45.   turtle.forward()
  46. end
  47.  
  48. function main()
  49.   for y=1,height-5,1 do
  50.     turtle.digDown()
  51.     turtle.dig()
  52.     for x=1,15,1 do
  53.       for z=1,15,1 do
  54.         move()
  55.       end
  56.       if x % 1 == 0 then
  57.         turtle.turnLeft()
  58.         move()
  59.         turtle.turnLeft()
  60.       else
  61.         turtle.turnRight()
  62.         move()
  63.         turtle.turnRight()
  64.       end
  65.     end
  66.   end
  67. end
  68.  
  69. main()
Advertisement
Add Comment
Please, Sign In to add comment