Advertisement
minicl55

Untitled

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