Advertisement
jhughey99

EzMin

Oct 1st, 2022
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.22 KB | None | 0 0
  1. print("Place Chest In Slot 16")
  2.  
  3. while turtle.getItemCount(16) == 0 do
  4. end
  5.  
  6.  
  7. write("Forward:")
  8.  
  9. local f = tonumber(read())
  10.  
  11.  
  12. write("Right:")
  13.  
  14. local r = tonumber(read())
  15.  
  16.  
  17. write("Up:")
  18.  
  19. local u = tonumber(read())
  20.  
  21.  
  22. function forward()
  23.     local keepGoing = true
  24.     while keepGoing do
  25.         if turtle.forward() then
  26.             keepGoing = false
  27.         end
  28.     end
  29. end
  30.  
  31. function up()
  32.     local keepGoing = true
  33.     while keepGoing do
  34.         if turtle.up() then
  35.             keepGoing = false
  36.         end
  37.     end
  38. end
  39.  
  40. function down()
  41.     local keepGoing = true
  42.     while keepGoing do
  43.         if turtle.down() then
  44.             keepGoing = false
  45.         end
  46.     end
  47. end
  48.  
  49. function chest()
  50.   turtle.select(16)
  51.   while turtle.place() == false do
  52.   end
  53.   turtle.select(1)
  54.   turtle.drop()
  55.   turtle.dig()
  56.   turtle.transferTo(16)
  57. end
  58.  
  59. function chestUp()
  60.   turtle.select(16)
  61.   while turtle.placeUp() == false do
  62.   end
  63.   turtle.select(1)
  64.   turtle.dropUp()
  65.   turtle.digUp()
  66.   turtle.transferTo(16)
  67. end
  68.  
  69. turtle.select(1)
  70.  
  71. for i = 1, u do
  72.     for j = 1, r do
  73.             for k = 1, f-1 do
  74.                 turtle.dig()
  75.                 chest()
  76.                 forward()
  77.             end
  78.             if j ~= r then
  79.                 if j%2 ~= 0 then
  80.                     turtle.turnRight()
  81.                     turtle.dig()
  82.                     chest()
  83.                     forward()
  84.                     turtle.turnRight()
  85.                 end
  86.                 if j%2 == 0 then
  87.                     turtle.turnLeft()
  88.                     turtle.dig()
  89.                     chest()
  90.                     forward()
  91.                     turtle.turnLeft()
  92.                 end
  93.             end
  94.     end
  95.  
  96.     if r%2 == 0 then
  97.         turtle.turnRight()
  98.         for b = 1, r-1 do
  99.             forward()
  100.         end
  101.         turtle.turnRight()
  102.     end
  103.  
  104.     if r%2 ~= 0 then
  105.         for b = 1, f-1 do
  106.             turtle.back()
  107.         end
  108.         turtle.turnLeft()
  109.         for b = 1, r-1 do
  110.             forward()
  111.         end
  112.         turtle.turnRight()
  113.     end
  114.  
  115.     if i ~= u then
  116.         turtle.digUp()
  117.         chestUp()
  118.         up()
  119.     end
  120. end
  121.  
  122. for d = 1, u-1 do
  123.     down()
  124. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement