Advertisement
Jeyjey0

stripmine

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