JoshuaKade

Untitled

Jun 16th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. print("+-------------------------------------+")
  4. print("|  Please place fuel in the lower-    |")
  5. print("|  right slot.                        |")
  6. print("|  Place building materials in the    |")
  7. print("|  remaining slots.                   |")
  8. print("+-------------------------------------+")
  9. sleep(1)
  10. print("How big of a square do you want? ")
  11.  
  12. sqrSize = read()
  13.  
  14. function plcColumn()
  15.   for i = 1, sqrSize[1] do
  16.     turtle.forward()
  17.     turtle.placeDown()
  18.   end
  19. end
  20.  
  21. --Even Column Placement
  22.  
  23. function aa()
  24.     turtle.placeDown()
  25.     plcColumn()
  26.     turtle.turnLeft()
  27.     turtle.forward()
  28.     turtle.turnLeft()
  29. end
  30.  
  31. --Odd Column Placement
  32.  
  33. function ab()
  34.     turtle.placeDown()
  35.     plcColumn()
  36.     turtle.turnRight()
  37.     turtle.forward()
  38.     turtle.turnRight()
  39. end
  40.  
  41. if sqrSize %2 == 0 then
  42.   isEven = true
  43. else
  44.   isEven = false
  45. end
  46.  
  47. --print(isEven)
  48. --Test for isEven ^
  49.  
  50.  
  51. function fltSqr()
  52.   if isEven == true then
  53.     for i = 1, sqrSize[1]/2 do
  54.       aa()
  55.       ab()
  56.     end
  57.   else
  58.     for i = 1, sqrSize[1]/2 do
  59.       aa()
  60.       ab()
  61.     end
  62.     aa()
  63.   end
  64. end
  65.  
  66. function bldWall()
  67.   for i = 1,4 do
  68.     plcColumn()
  69.     turtle.turnLeft()
  70.     turtle.up()
  71.   end
  72. end  
  73.  
  74. slotNum = 0
  75.  
  76. while true do
  77.  
  78.   turtle.getItemCount(slotNum) = itemCount
  79.   for i = 0, 14 do
  80.     turtle.getItemCount(slotNum) = itemCount
  81.       if itemCount == 0 then
  82.         slotNum + 1
  83.         turtle.select(slotNum)
  84.       end
  85.       sleep(10)
  86.   end
  87. end
  88.      
  89. sqrHeight = sqrSize[2]
  90.  
  91. fltSqr()
  92. turtle.up()
  93. for i = 1, sqrHeight do
  94.   bldWall()
  95. end
  96. fltSqr()
Advertisement
Add Comment
Please, Sign In to add comment