Advertisement
Jeyjey0

STRIPMINE3

Nov 13th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. os.unloadAPI("mine")
  2. os.unloadAPI("mine2")
  3. os.unloadAPI("mine3")
  4. os.unloadAPI("mine4")
  5. os.unloadAPI("torch")
  6. os.unloadAPI("detect")
  7. os.loadAPI("mine")
  8. os.loadAPI("mine2")
  9. os.loadAPI("mine3")
  10. os.loadAPI("mine4")
  11. os.loadAPI("torch")
  12. os.loadAPI("detect")
  13. score = 0
  14. fuel = turtle.getFuelLevel()
  15. if fuel < 10 == true then
  16. term.clear()
  17. term.setCursorPos(1,1)
  18. print("NO/LOW FUEL")
  19. error()
  20. end
  21. term.clear()
  22. turtle.turnLeft()
  23. distance = 0
  24. local check = 0
  25. turtle.turnLeft()
  26. if turtle.detect() == true then
  27. chest = 1
  28. else
  29. chest = 2
  30. end
  31. h = fs.open("/stripmineprogramm/number","w")
  32. h.write(distance)
  33. h.close()
  34. mined = 0
  35. turtle.turnLeft()
  36. turtle.turnLeft()
  37. local tArgs = {...}
  38. if #tArgs < 2 == true or #tArgs > 2 == true then
  39. local er2 = 0
  40. print(" ERROR: Stripmine <Number> <number>")
  41. error()
  42. end
  43. input1 = tonumber(tArgs[1])
  44. input2 = tonumber(tArgs[2])
  45. if tonumber(input1) ~= nil or tonumber(input2) ~= nil then
  46. else
  47. print("ERROR: stripmine <Number> <Number>")
  48. error()
  49. end
  50. print("Calculate fuel ...")
  51. fuel = turtle.getFuelLevel()
  52. cal1 = ( input1*3 + input2 + input2 * 0.5 ) * 2
  53. block = input1 *3 * 2 + (input2 + input2) * 2 * input1
  54. print("Fuel needed :",cal1)
  55. print("Your FUEL: ",fuel)
  56. sleep(1.25)
  57. mineblock = 0
  58. if chest == 1 == true then
  59. term.clear()
  60. term.setCursorPos(1, 1)
  61. print("CHEST: ON")
  62. end
  63. if chest == 2 == true then
  64. term.clear()
  65. term.setCursorPos(1, 1)
  66. print("CHEST: OFF")
  67. end
  68. sleep(0.75)
  69. term.clear()
  70. term.setCursorPos(1, 1)
  71. fucoun = turtle.getFuelLevel()
  72. print("Fuel: ",fucoun)
  73. print("Mining Blocks: ",block)
  74. print("Mined Blocks: ",score)
  75. for i=1,input1 do
  76. mine2.mine()
  77. mine.bridge()
  78. detect.sideLeft()
  79. detect.sideRight()
  80. turtle.up()
  81. detect.sideLeft()
  82. detect.sideRight()
  83. turtle.down()
  84. score = score +1
  85. score = score+1
  86. term.clear()
  87. term.setCursorPos(1, 1)
  88. fucoun = turtle.getFuelLevel()
  89. print("Fuel: ",fucoun)
  90. print("Mining Blocks: ",block)
  91. print("Mined Blocks: ",score)
  92. mineblock = mineblock + 1
  93. mine2.mine()
  94. mine.bridge()
  95. detect.sideLeft()
  96. detect.sideRight()
  97. turtle.up()
  98. detect.sideLeft()
  99. detect.sideRight()
  100. turtle.down()
  101. score = score +1
  102. score = score+1
  103. term.clear()
  104. term.setCursorPos(1, 1)
  105. fucoun = turtle.getFuelLevel()
  106. print("Fuel: ",fucoun)
  107. print("Mining Blocks: ",block)
  108. print("Mined Blocks: ",score)
  109. mineblock = mineblock + 1
  110. mine2.mine()
  111. mine.bridge()
  112. detect.sideLeft()
  113. detect.sideRight()
  114. turtle.up()
  115. detect.sideLeft()
  116. detect.sideRight()
  117. turtle.down()
  118. score = score +1
  119. score = score+1
  120. term.clear()
  121. term.setCursorPos(1, 1)
  122. fucoun = turtle.getFuelLevel()
  123. print("Fuel: ",fucoun)
  124. print("Mining Blocks: ",block)
  125. print("Mined Blocks: ",score)
  126. mineblock = mineblock + 1
  127. if mineblock > 4 == true then
  128. torch.torch()
  129. mineblock = 0
  130. end
  131. turtle.turnLeft()
  132. for i=1,input2 do
  133. mine2.mine()
  134. detect.sideLeft()
  135. detect.sideRight()
  136. turtle.up()
  137. detect.sideLeft()
  138. detect.sideRight()
  139. turtle.down()
  140. mine.bridge()
  141. score = score +1
  142. score = score+1
  143. term.clear()
  144. term.setCursorPos(1, 1)
  145. fucoun = turtle.getFuelLevel()
  146. print("Fuel: ",fucoun)
  147. print("Mining Blocks: ",block)
  148. print("Mined Blocks: ",score)
  149. end
  150. turtle.turnLeft()
  151. turtle.turnLeft()
  152. for i =1,input2 do
  153. mine2.mine()
  154. end
  155. for i=1,input2 do
  156. mine2.mine()
  157. detect.sideLeft()
  158. detect.sideRight()
  159. turtle.up()
  160. detect.sideLeft()
  161. detect.sideRight()
  162. turtle.down()
  163. mine.bridge()
  164. score = score +1
  165. score = score+1
  166. term.clear()
  167. term.setCursorPos(1, 1)
  168. fucoun = turtle.getFuelLevel()
  169. print("Fuel: ",fucoun)
  170. print("Mining Blocks: ",block)
  171. print("Mined Blocks: ",score)
  172. end
  173. turtle.turnLeft()
  174. turtle.turnLeft()
  175. for i =1,input2 do
  176. mine2.mine()
  177. end
  178. distance = distance + 1
  179. h = fs.open("/stripmineprogramm/number","w")
  180. h.write(distance)
  181. h.close()
  182. turtle.turnRight()
  183. drop2 = 0
  184. for i =1,16 do
  185. drop2 = drop2 + 1
  186. turtle.select(drop2)
  187. count3 = turtle.getItemCount()
  188. if count3 >= 1 == true then
  189. item = turtle.getItemDetail()
  190. if item.name == "minecraft:torch" == false then
  191. item2 = turtle.getItemCount()
  192. mined = mined + item2
  193. end
  194. end
  195. end
  196. if chest == 1 == true then
  197. mine3.check()
  198. mine4.refuel()
  199. end
  200. end
  201. if chest == 1 == true then
  202. turtle.turnLeft()
  203. turtle.turnLeft()
  204. turtle.up()
  205. te = input1*3
  206. for i = 1,te do
  207. mine2.mine2()
  208. end
  209. turtle.down()
  210. mine.clear()
  211. end
  212. term.clear()
  213. term.setCursorPos(1,1)
  214. print("Finish")
  215. print("Items Mined: ",score)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement