Advertisement
Guest User

Untitled

a guest
Nov 20th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.67 KB | None | 0 0
  1. Loopcount = {12, 6}
  2. EnableMessage = true;
  3.  
  4. --This function positions my turtle in front of the blocks
  5. function positionMyTurtle()
  6.  
  7. if EnableMessage==true then
  8.  
  9. print(MessagePosition)
  10.  
  11. end
  12.  
  13. while turtle.detect() == false do
  14. turtle.forward()
  15. end
  16.  
  17. end
  18.  
  19.  
  20.  
  21. --This function is used to gather blocks that I need for my pyramid’s first floor
  22. function getMyBlocksForFirstFloor(amountF1)
  23.  
  24. print(“Getting blocks for first floor)
  25.  
  26. for i = 1, amountF1 do
  27. turtle.digUp()
  28. --turtle.suck()
  29. turtle.up()
  30. end
  31.  
  32. turtle.turnRight()
  33. turtle.dig()
  34. turtle.forward()
  35.  
  36. for i = 1, amountF1 do
  37. turtle.digDown()
  38. turtle.down()
  39. end
  40.  
  41. turtle.forward()
  42. turtle.dig()
  43. turtle.forward()
  44.  
  45. for i = 1, amountF1 do
  46. turtle.digUp()
  47. --turtle.suck()
  48. turtle.up()
  49. end
  50.  
  51. turtle.turnLeft()
  52. turtle.dig()
  53. turtle.forward()
  54.  
  55. for i = 1, amountF1 do
  56. turtle.digDown()
  57. turtle.down()
  58.  
  59. end
  60.  
  61. turtle.dig()
  62. turtle.forward()
  63.  
  64. for i = 1, 8 do
  65. turtle.digUp()
  66. turtle.up()
  67.  
  68. end
  69.  
  70. --Put turtle in position for level 2
  71. while turtle.detectDown() == false do
  72. turtle.down()
  73. end
  74.  
  75. turtle.back()
  76. turtle.back()
  77. turtle.turnRight()
  78.  
  79. --End of function getMyBlocksForFirstFloor
  80. end
  81.  
  82.  
  83.  
  84. --This function is used to gather blocks that I need for my pyramid’s second floor
  85. function getMyBlocksForSecondFloor(amountF2)
  86.  
  87. print(“Getting blocks for second floor)
  88.  
  89. turtle.dig()
  90. turtle.forward()
  91. turtle.turnLeft()
  92.  
  93. for i = 1, amountF2 do
  94. turtle.digUp()
  95. --turtle.suck()
  96. turtle.up()
  97. end
  98.  
  99. turtle.turnRight()
  100. turtle.dig()
  101. turtle.forward()
  102.  
  103. for i = 1, amountF2 do
  104. turtle.digDown()
  105. turtle.down()
  106. end
  107.  
  108. turtle.turnLeft()
  109. turtle.dig()
  110. turtle.forward()
  111.  
  112. for i = 1, Loopcount[2] do
  113. turtle.digUp()
  114. --turtle.suck()
  115. turtle.up()
  116. end
  117.  
  118. --Put turtle in position for level 3
  119. while turtle.detectDown() == false do
  120. turtle.down()
  121. end
  122.  
  123. turtle.back()
  124. turtle.back()
  125. turtle.turnRight()
  126.  
  127. --End of function getMyBlocksForSecondFloor
  128. end
  129.  
  130.  
  131. --This function is used to gather blocks that I need for my pyramid’s third floor
  132. function getMyBlocksForThirdFloor(amountF3)
  133.  
  134. print(“Getting blocks for third floor)
  135.  
  136. turtle.forward()
  137. turtle.forward()
  138. turtle.turnLeft()
  139. turtle.dig()
  140. turtle.forward()
  141.  
  142.  
  143. for i = 1, amountF3 do
  144. turtle.digUp()
  145. turtle.up()
  146. end
  147.  
  148. --Put turtle in position for level 4
  149. while turtle.detectDown() == false do
  150. turtle.down()
  151. end
  152.  
  153. turtle.back()
  154. turtle.turnRight()
  155. turtle.forward()
  156. turtle.forward()
  157. turtle.forward()
  158. turtle.forward()
  159.  
  160. --End of function getMyBlocksForThirdFloor
  161. end
  162.  
  163.  
  164.  
  165. --This function is used to gather blocks that I need for my pyramid’s fourth floor
  166. function getMyBlocksForFourthFloor()
  167.  
  168. print(“Getting blocks for fourth floor)
  169.  
  170. turtle.turnLeft()
  171. turtle.dig()
  172. turtle.forward()
  173.  
  174. turtle.dig()
  175. turtle.forward()
  176.  
  177. turtle.dig()
  178. turtle.forward()
  179.  
  180. turtle.turnRight()
  181. turtle.turnRight()
  182. while turtle.detect() == false do
  183. turtle.forward()
  184. end
  185.  
  186. turtle.turnRight()
  187. while turtle.detect() == false do
  188. turtle.forward()
  189. end
  190.  
  191. turtle.drop()
  192. turtle.select(1)
  193. turtle.drop()
  194. turtle.select(2)
  195. turtle.drop()
  196. turtle.select(3)
  197. turtle.drop()
  198. turtle.select(4)
  199. turtle.drop()
  200.  
  201. --End of function getMyBlocksForFourthFloor
  202. end
  203.  
  204. --My positionMyTurtle function is run here
  205. positionMyTurtle()
  206.  
  207. --My turtle digs its first hole and moves into place
  208. turtle.dig()
  209. turtle.forward()
  210.  
  211. --My getMyBlocksForFirstFloor function is run here
  212. getMyBlocksForFirstFloor(Loopcount[1])
  213.  
  214. --My getMyBlocksForSecondFloor function is run here
  215. getMyBlocksForSecondFloor(Loopcount[1])
  216.  
  217.  
  218. --My getMyBlocksForThirdFloor function is run here
  219. getMyBlocksForThirdFloor(Loopcount[1])
  220. --My getMyBlocksForFourthFloor function is run here
  221. getMyBlocksForFourthFloor()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement