Advertisement
Guest User

Portalbuilder

a guest
Sep 9th, 2013
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function refill()
  2.    
  3.     turtle.turnRight()
  4.     turtle.turnRight()
  5.  
  6.         turtle.select(1)
  7.         while turtle.getItemCount(15) < 64 do
  8.  
  9.         turtle.suck()
  10.  
  11.         end
  12.     turtle.turnLeft()
  13.     turtle.turnLeft()
  14.  
  15.         turtle.select(15)
  16.  
  17. end
  18.  
  19. function horizontal()
  20.  
  21.  
  22.     checkBlocks()
  23.  
  24.     for i = 1, x do
  25.  
  26.     for i = 1, 3 do
  27.  
  28.       turtle.up()
  29.       turtle.place()
  30.    
  31.     end
  32.  
  33.     turtle.up()
  34.    
  35.     end
  36.  
  37.   for i = 1, (x*4) do
  38.  
  39.     turtle.down()
  40.    
  41.   end
  42.  
  43. end
  44.  
  45. function checkBlocks()
  46.  
  47.     if turtle.getItemCount(s) < 5 then
  48.  
  49.             s = s - 1
  50.             turtle.select(s)
  51.  
  52.     end
  53.  
  54. end
  55.  
  56. function footnhead()
  57.  
  58.   for i = 1, x do
  59.  
  60.         checkBlocks()
  61.  
  62.     turtle.place()
  63.    
  64.     for i = 1, 4 do
  65.        
  66.       turtle.up()
  67.      
  68.     end
  69.    
  70.     turtle.place()
  71.    
  72.    
  73.   end
  74.  
  75.   turtle.turnRight()
  76.   turtle.forward()
  77.   turtle.turnLeft()
  78.  
  79.   for i = 1, x do
  80.  
  81.     turtle.place()
  82.    
  83.     for i = 1, 4 do
  84.    
  85.       turtle.down()  
  86.    
  87.     end
  88.  
  89.     turtle.place()
  90.    
  91.   end
  92.  
  93. end
  94.  
  95. function depth()
  96.  
  97.     checkBlocks()
  98.  
  99.     turtle.turnRight()
  100.     turtle.forward()
  101.     turtle.turnLeft()
  102.     turtle.forward()
  103.     turtle.forward()
  104.     turtle.turnLeft()
  105.  
  106.     for i = 1, y do
  107.  
  108.         for i = 1, z do
  109.             footnhead()
  110.             turtle.up()
  111.    
  112.             for i = 1, 3 do
  113.    
  114.                 turtle.forward()
  115.  
  116.             end
  117.  
  118.             turtle.down()
  119.             turtle.turnLeft()
  120.             turtle.forward()
  121.             turtle.turnRight()
  122.  
  123.         end
  124.  
  125.         footnhead()
  126.         turtle.up()
  127.  
  128.         for i = 1, z * 3 do
  129.    
  130.             turtle.back()
  131.  
  132.         end
  133.  
  134.         turtle.turnRight()
  135.         turtle.forward()
  136.         turtle.forward()
  137.         turtle.turnLeft()
  138.         turtle.forward()
  139.         turtle.turnLeft()
  140.         turtle.down()
  141.  
  142.         for i = 1, z do
  143.  
  144.         horizontal()
  145.  
  146.       turtle.turnRight()
  147.       turtle.forward()
  148.       turtle.turnLeft()
  149.      
  150.         footnhead()
  151.  
  152.         turtle.turnRight()
  153.       turtle.forward()
  154.       turtle.turnLeft()
  155.  
  156.         end
  157.    
  158.         horizontal()
  159.         turtle.turnRight()
  160.  
  161.         for i = 1, z * 3 + 1 do
  162.        
  163.             turtle.back()
  164.  
  165.         end
  166.  
  167.     end    
  168.  
  169. end
  170.  
  171. function portal()
  172.  
  173.     for i = 1, z do
  174.  
  175.         horizontal()
  176.  
  177.       turtle.turnRight()
  178.       turtle.forward()
  179.       turtle.turnLeft()
  180.      
  181.         footnhead()
  182.  
  183.         turtle.turnRight()
  184.       turtle.forward()
  185.       turtle.turnLeft()
  186.  
  187.     end
  188.  
  189.     horizontal()
  190.     depth()
  191.  
  192.     turtle.turnRight()
  193.     turtle.forward()
  194.     turtle.turnLeft()
  195.    
  196.     for i = 1, y * 4 do
  197.        
  198.         turtle.forward()
  199.  
  200.     end
  201.  
  202.     turtle.forward()
  203.     turtle.turnLeft()
  204.     turtle.forward()
  205.     turtle.turnLeft()
  206. end
  207.  
  208. s = 15
  209.  
  210. print("Enter height: ")
  211. x = io.read()
  212. print("Enter width: ")
  213. z = io.read()
  214. print("Enter depth: ")
  215. y = io.read()
  216.  
  217. if turtle.getItemCount(1) < x*8 then
  218.  
  219.     refill()
  220.  
  221. end
  222. turtle.select(15)
  223. portal()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement