Advertisement
Guest User

buildTunnel

a guest
Dec 7th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.65 KB | None | 0 0
  1. local l = ...
  2.  
  3. function buildFancyStone()
  4.     for i=1,16 do
  5.         if turtle.getItemCount(i) > 0 then
  6.             data = turtle.getItemDetail(i)
  7.             if data.name == "TConstruct:decoration.multibrickfancy" then
  8.                 turtle.select(i)
  9.                 break
  10.             end
  11.         end
  12.     end
  13.     turtle.place()
  14. end
  15.  
  16. function buildStoneWall()
  17.     for i=1,16 do
  18.         if turtle.getItemCount(i) > 0 then 
  19.             data = turtle.getItemDetail(i)
  20.             if data.name == "chisel:stonebricksmooth" then
  21.                 turtle.select(i)
  22.                 break
  23.             end
  24.         end
  25.     end
  26.     turtle.place()
  27. end
  28.  
  29. function buildCobblestone()
  30.     for i=1,16 do
  31.         if turtle.getItemCount(i) > 0 then
  32.             data = turtle.getItemDetail(i)
  33.             if data.name == "minecraft:cobblestone" then
  34.                 turtle.select(i)
  35.                 break
  36.             end
  37.         end
  38.     end
  39.     turtle.place()
  40. end
  41.  
  42. function buildGlass()
  43.     for i=1,16 do
  44.         if turtle.getItemCount(i) > 0 then
  45.             data = turtle.getItemDetail(i)
  46.             if data.name == "chisel:glass" then
  47.                 turtle.select(i)
  48.                 break
  49.             end
  50.         end
  51.     end
  52.     turtle.place()
  53. end
  54.  
  55. function right(val)
  56.     turtle.turnRight()
  57.     for i=1,val do
  58.         turtle.dig()
  59.         turtle.forward()
  60.     end
  61.     turtle.turnLeft()
  62. end
  63.  
  64. function left(val)
  65.     turtle.turnLeft()
  66.     for i=1,val do
  67.         turtle.dig()
  68.         turtle.forward()
  69.     end
  70.     turtle.turnRight()
  71. end
  72.  
  73. function buildGlassTunnel()
  74.     turtle.back()
  75.    
  76.     for i=1,4 do
  77.         buildGlass()
  78.         turtle.up()
  79.     end
  80.     for i=1,2 do
  81.         right(1)
  82.         buildGlass()
  83.     end
  84.     turtle.up()
  85.     for i=1,3 do
  86.         right(1)
  87.         buildGlass()
  88.     end
  89.    
  90.     right(1)
  91.     turtle.down()
  92.    
  93.     for i=1,2 do
  94.         buildGlass()
  95.         right(1)
  96.     end
  97.     for i=1,4 do
  98.         turtle.down()
  99.         buildGlass()
  100.     end
  101.     left(8)
  102.     print("Glass finished...\n")
  103. end
  104.  
  105. function buildFancyStoneTunnel()
  106.     turtle.back()
  107.    
  108.     for i=1,4 do
  109.         buildFancyStone()
  110.         turtle.up()
  111.     end
  112.     for i=1,2 do
  113.         right(1)
  114.         buildFancyStone()
  115.     end
  116.     turtle.up()
  117.     for i=1,3 do
  118.         right(1)
  119.         buildFancyStone()
  120.     end
  121.    
  122.     right(1)
  123.     turtle.down()
  124.    
  125.     for i=1,2 do
  126.         buildFancyStone()
  127.         right(1)
  128.     end
  129.     for i=1,4 do
  130.         turtle.down()
  131.         buildFancyStone()
  132.     end
  133.     left(8)
  134.     print("FancyStone finished...\n")
  135. end
  136.  
  137. function buildStoneWallTunnel(var)
  138.     for i=1,var do
  139.         turtle.back()
  140.        
  141.         for i=1,4 do
  142.             buildStoneWall()
  143.             turtle.up()
  144.         end
  145.         for i=1,2 do
  146.             right(1)
  147.             buildStoneWall()
  148.         end
  149.         turtle.up()
  150.         for i=1,3 do
  151.             right(1)
  152.             buildStoneWall()
  153.         end
  154.        
  155.         right(1)
  156.         turtle.down()
  157.        
  158.         for i=1,2 do
  159.             buildStoneWall()
  160.             right(1)
  161.         end
  162.         for i=1,4 do
  163.             turtle.down()
  164.             buildStoneWall()
  165.         end
  166.         left(8)
  167.     end
  168.     print("Stonewall finished...\n")
  169. end
  170.  
  171. function execute()
  172.     buildGlassTunnel()
  173.     buildFancyStoneTunnel()
  174.     buildStoneWallTunnel(3)
  175.     buildFancyStoneTunnel()
  176. end
  177.  
  178. for i=1,l do
  179.     execute()
  180. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement