Advertisement
FangLargo

aestheticPyramid

Jul 26th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. blockSlot = 1
  2. fuelSlot = 16
  3.  
  4. args = {...}
  5. size = tonumber(args[1])
  6. buildingBlockID = turtle.getItemDetail(1).name
  7. facing = "north"
  8.  
  9.  
  10. function placeBlockSlot()
  11.     blockSlot = 0
  12.     repeat
  13.         blockSlot = blockSlot + 1
  14.         if turtle.getItemDetail(blockSlot) ~= buildingBlockID then
  15.             turtle.drop()
  16.             if blockSlot > 1 then
  17.                 blockSlot = blockSlot - 1
  18.             end
  19.         end
  20.     until(turtle.getItemCount(blockSlot) > 0)
  21.    
  22.    
  23.     turtle.select(blockSlot)
  24.     turtle.placeDown()
  25. end
  26.  
  27. function checkRefuel()
  28.     if turtle.getFuelLevel() == 0 then
  29.         turtle.select(fuelSlot)
  30.         if turtle.getItemCount() > 0 then
  31.             turtle.refuel(1)
  32.         else
  33.             fuelSlot = fuelSlot + 1
  34.             turtle.refuel(1)
  35.             running = false
  36.         end
  37.     end
  38. end
  39.  
  40. function layLines(num)
  41.     currentNum = 0
  42.     repeat
  43.    
  44.         checkRefuel()
  45.            
  46.         turtle.forward()
  47.        
  48.         turtle.dig()
  49.         turtle.digDown()
  50.                
  51.         placeBlockSlot()
  52.        
  53.         currentNum = currentNum + 1
  54.     until(currentNum >= num)
  55.     --Ends on top of last block
  56. end
  57.  
  58. function layRim(rimSize)
  59.     side = 0
  60.    
  61.     repeat
  62.         layLines(rimSize)
  63.         turtle.turnRight()
  64.        
  65.         side = side + 1
  66.     until(side == 4)
  67.    
  68.     side = 0
  69.    
  70.     --Ends on bottom left most corner
  71.     turtle.turnRight()
  72.     turtle.forward()
  73.     turtle.turnLeft()
  74.     turtle.forward()
  75.     --Gets to bottom left of next rim.
  76.    
  77.  
  78.     repeat
  79.         layLines(rimSize - 2)
  80.         turtle.turnRight()
  81.        
  82.         side = side + 1
  83.     until(side == 4)
  84.  
  85. end
  86.  
  87. checkRefuel()
  88. turtle.digUp()
  89. turtle.up()
  90.  
  91. repeat
  92.     layRim(size)
  93.     size = size - 2
  94.    
  95.     checkRefuel()
  96.     turtle.digUp()
  97.     turtle.up()
  98.    
  99. until(size <= 0)
  100.  
  101. placeBlockSlot()
  102.    
  103. --pastebin get rTFAD0YE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement