Advertisement
bjohnston562

32 diameter house builder

Nov 13th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. function check()
  2. local g=2
  3. if turtle.getItemCount(s)==0
  4. then
  5. s=s+1
  6. if s<17
  7. then
  8. turtle.select(s)
  9. else
  10. s=1
  11. turtle.select(s)
  12. while g == 2
  13. do
  14. print("Waiting for supplies. Type 1 to continue building.")
  15. g=read()
  16. end
  17. end
  18. end
  19. end
  20.  
  21. ---------------------------------------------------------------------------
  22. print("How high do you want you tower?")
  23. y=read()
  24. tonumber(y)
  25. s=1
  26. turtle.select(1)
  27. for b=1, y
  28. do
  29. for i=1,4
  30. do
  31. check() -- begining of 4 section
  32. turtle.placeDown()
  33. sleep(.1)
  34. turtle.forward()
  35. check()
  36. turtle.placeDown()
  37. sleep(.1)
  38. turtle.forward()
  39. check()
  40. turtle.placeDown()
  41. sleep(.1)
  42. turtle.forward()
  43. check()
  44. turtle.placeDown() -- end of 4 section
  45.  
  46. sleep(.1) --reposition for 3
  47. turtle.forward()
  48. sleep(.1)
  49. turtle.turnRight()
  50. sleep(.1)
  51. turtle.forward()
  52. sleep(.1)
  53. turtle.turnLeft()
  54. sleep(.1)
  55.  
  56. check() --start of 3 section
  57. turtle.placeDown()
  58. sleep(.1)
  59. turtle.forward()
  60. check()
  61. turtle.placeDown()
  62. sleep(.1)
  63. turtle.forward()
  64. check()
  65. turtle.placeDown() --end of 3 section
  66.  
  67. sleep(.1) --reposition for 1
  68. turtle.forward()
  69. sleep(.1)
  70. turtle.turnRight()
  71. sleep(.1)
  72. turtle.forward()
  73. sleep(.1)
  74. turtle.turnLeft()
  75. sleep(.1)
  76.  
  77. check() --start 1
  78. turtle.placeDown()
  79.  
  80. sleep(.1) --repostion for 2
  81. turtle.forward()
  82. sleep(.1)
  83. turtle.turnRight()
  84. sleep(.1)
  85. turtle.forward()
  86. sleep(.1)
  87. turtle.turnLeft()
  88. sleep(.1)
  89.  
  90. check() --start of 2 section
  91. turtle.placeDown()
  92. sleep(.1)
  93. turtle.forward()
  94. check()
  95. turtle.placeDown() --end of section 2
  96.  
  97. sleep(.1) --repostion for 1
  98. turtle.forward()
  99. sleep(.1)
  100. turtle.turnRight()
  101. sleep(.1)
  102. turtle.forward()
  103. sleep(.1)
  104. turtle.turnLeft()
  105. sleep(.1)
  106.  
  107. check() --start 1
  108. turtle.placeDown()
  109.  
  110. sleep(.1) --repostion for 1
  111. turtle.forward()
  112. sleep(.1)
  113. turtle.turnRight()
  114. sleep(.1)
  115. turtle.forward()
  116. sleep(.1)
  117. turtle.turnLeft()
  118. sleep(.1)
  119.  
  120. check() --start 1
  121. turtle.placeDown()
  122.  
  123. sleep(.1) --reposition for 2
  124. turtle.forward()
  125. sleep(.1)
  126. turtle.turnRight()
  127. sleep(.1)
  128. turtle.forward()
  129.  
  130. check() --start of 2 section
  131. turtle.placeDown()
  132. sleep(.1)
  133. turtle.forward()
  134. check()
  135. turtle.placeDown() --end of section 2
  136.  
  137. sleep(.1) --reposition 1
  138. turtle.forward()
  139. sleep(.1)
  140. turtle.turnLeft()
  141. sleep(.1)
  142. turtle.forward()
  143. turtle.turnRight()
  144.  
  145. check() --start 1
  146. turtle.placeDown()
  147.  
  148. sleep(.1) --reposition for 3
  149. turtle.forward()
  150. sleep(.1)
  151. turtle.turnLeft()
  152. sleep(.1)
  153. turtle.forward()
  154. turtle.turnRight()
  155.  
  156. check() --start of 3
  157. turtle.placeDown()
  158. sleep(.1)
  159. turtle.forward()
  160. sleep(.1)
  161. check()
  162. turtle.placeDown()
  163. sleep(.1)
  164. turtle.forward()
  165. sleep(.1)
  166. check()
  167. turtle.placeDown() --end of 3
  168.  
  169. sleep(.1) --reposition for 4
  170. turtle.forward()
  171. sleep(.1)
  172. turtle.turnLeft()
  173. sleep(.1)
  174. turtle.forward()
  175. turtle.turnRight()
  176.  
  177. check() -- begining of 4 section
  178. turtle.placeDown()
  179. sleep(.1)
  180. turtle.forward()
  181. check()
  182. turtle.placeDown()
  183. sleep(.1)
  184. turtle.forward()
  185. check()
  186. turtle.placeDown()
  187. sleep(.1)
  188. turtle.forward()
  189. check()
  190. turtle.placeDown() -- end of 4 section
  191.  
  192. turtle.forward() --for next cycle
  193. end
  194. sleep(.1)
  195. turtle.up()
  196. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement