Advertisement
Jeyjey0

Stripmine2

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