Advertisement
Plazter

quarry2 test

Oct 1st, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.02 KB | None | 0 0
  1. local block = 1
  2. local quarry = 13
  3. local tesseract = 16
  4. local landmark = 15
  5. local chest = 14
  6. local args = {...}
  7. local length = 10
  8. local height = 0
  9.  
  10.  
  11. function height()
  12.  
  13. term.clear()
  14. term.setCursorPos(1,1)
  15. print("Do you wish the turtle to setup the quarry in air?")
  16. print("Press Y/N to confirm")
  17. local event, key = os.pullEvent("key")
  18. if key == keys.y then
  19. print("How far up?")
  20. input = read()
  21. if input then
  22. height = tonumber(input)
  23. elseif key == keys.n then
  24. length()
  25. NQuarry()
  26. end
  27. return
  28. end
  29. end
  30.  
  31.  
  32. function checkFuel()
  33. term.clear()
  34. term.setCursorPos(1,1)
  35. print("Checking if i have enough fuel..")
  36.  
  37. sleep(2)
  38.  
  39. if turtle.getFuelLevel() >= 500 then
  40. print("Im fine on fuel thanks.. press enter to continue.")
  41. while true do
  42. local event, key = os.pullEvent("key")
  43. if key == keys.enter then
  44. return
  45. elseif turtle.getFuelLevel() < 500 then
  46. print("Please give me fuel master!")
  47. if key == keys.enter then
  48. turtle.refuel()
  49. end
  50.  
  51. end
  52. end
  53. end
  54.  
  55. function lenght()
  56. term.clear()
  57. term.setCursorPos(1,1)
  58.  
  59. print("How big do you want the quarry?")
  60. input = read()
  61.  
  62. if input then
  63. length = input
  64. elseif input == nil then
  65. print("Error..")
  66. end
  67.  
  68. print("You have said that you want the quarry to be: ".. tostring(length))
  69. print("Are you sure?")
  70. print("Press Y/N")
  71.  
  72. while true do
  73. local event, key = os.pullEvent("key")
  74. if key == keys.y then
  75. print("I'm gonna go a head and build you quarry!")
  76. sleep(2)
  77. Quarry()
  78. end
  79. if key == keys.n then
  80. print("You pressed N, breaking the program..")
  81. break
  82. end
  83. end
  84. end
  85.  
  86. function Quarry()
  87. for i = 0, height do
  88. turtle.up()
  89. end
  90.  
  91. -- [ Landmarks ] --
  92. for i = 1,length do
  93. turtle.forward()
  94. end
  95. turtle.select(block)
  96. turtle.forward()
  97. turtle.placeDown()
  98. turtle.back()
  99.  
  100. turtle.select(landmark)
  101. turtle.place()
  102.  
  103. for o = 1, length -1 do
  104. turtle.back()
  105. end
  106.  
  107. turtle.turnRight()
  108.  
  109. for p = 1,length do
  110. turtle.forward()
  111. end
  112.  
  113. turtle.select(block)
  114. turtle.forward()
  115. turtle.placeDown()
  116. turtle.back()
  117. turtle.select(landmark)
  118. turtle.place()
  119.  
  120. for a = 1, length do
  121. turtle.back()
  122. end
  123.  
  124. turtle.turnLeft()
  125. turtle.select(block)
  126. turtle.placeDown()
  127. turtle.back()
  128. turtle.select(landmark)
  129. turtle.place()
  130. turtle.attack()
  131. -- [ Landmarks end] --
  132. turtle.back()
  133. turtle.select(quarry)
  134. turtle.place()
  135. turtle.up()
  136. turtle.select(chest)
  137. turtle.place()
  138. turtle.back()
  139. turtle.down()
  140. turtle.select(tesseract)
  141. turtle.place()
  142. print("Done.")
  143. for i = 0, height do
  144. turtle.down()
  145. end
  146. end
  147.  
  148.  
  149. function NQuarry()
  150. -- [ Landmarks ] --
  151. for i = 1,length do
  152. turtle.forward()
  153. end
  154. turtle.select(block)
  155. turtle.forward()
  156. turtle.placeDown()
  157. turtle.back()
  158.  
  159. turtle.select(landmark)
  160. turtle.place()
  161.  
  162. for o = 1, length -1 do
  163. turtle.back()
  164. end
  165.  
  166. turtle.turnRight()
  167.  
  168. for p = 1,length do
  169. turtle.forward()
  170. end
  171.  
  172. turtle.select(block)
  173. turtle.forward()
  174. turtle.placeDown()
  175. turtle.back()
  176. turtle.select(landmark)
  177. turtle.place()
  178.  
  179. for a = 1, length do
  180. turtle.back()
  181. end
  182.  
  183. turtle.turnLeft()
  184. turtle.select(block)
  185. turtle.placeDown()
  186. turtle.back()
  187. turtle.select(landmark)
  188. turtle.place()
  189. turtle.attack()
  190. -- [ Landmarks end] --
  191. turtle.back()
  192. turtle.select(quarry)
  193. turtle.place()
  194. turtle.up()
  195. turtle.select(chest)
  196. turtle.place()
  197. turtle.back()
  198. turtle.down()
  199. turtle.select(tesseract)
  200. turtle.place()
  201. print("Done.")
  202.  
  203. end
  204.  
  205. function itemsSlot()
  206. term.clear()
  207. term.setCursorPos(1,1)
  208. print("Place following items in slot:")
  209. print("Block for air placement: 1")
  210. print("Quarry: 13")
  211. print("Chest: 14")
  212. print("Landmarks: 15")
  213. print("Tesseract: 16")
  214. sleep(10)
  215. end
  216. -- [Main program] --
  217. itemsSlot()
  218. checkFuel()
  219. height()
  220. lenght()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement