Advertisement
Plazter

test123

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