Jeyjey0

stripmine-program

Oct 24th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. if not fs.exists("mine") == true or not fs.exists("mine2") == true or not fs.exists("mine3") == true then
  2. shell.run("pastebin get DR91aDvE mine")
  3. shell.run("pastebin get YgXdrd9z mine2")
  4. shell.run("pastebin get SzSkce8k mine3")
  5. end
  6.  
  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. turtle.turnLeft()
  21. turtle.turnLeft()
  22. term.setCursorPos(1, 1)
  23. os.loadAPI("mine")
  24. os.loadAPI("mine2")
  25. os.loadAPI("mine3")
  26. print("------------------------------------")
  27. print(" STRIP-MINE")
  28. print("------------------------------------")
  29. score = 0
  30. print("How long can be the strip tunnel?")
  31. input1 = tonumber(read())
  32. print("How long can the turtle dig in the sites")
  33. input2 = tonumber(read())
  34. print("Calculate fuel ...")
  35. fuel = turtle.getFuelLevel()
  36. cal1 = ( input1*3 + input2 + input2 * 0.5 ) * 2
  37. block = input1 *3 * 2 + (input2 + input2) * 2 * input1
  38. print("Fuel needed :",cal1)
  39. print("Your FUEL: ",fuel)
  40. sleep(1.25)
  41. mineblock = 0
  42. if chest == 1 == true then
  43. term.clear()
  44. term.setCursorPos(1, 1)
  45. print("CHEST: ON")
  46. end
  47. if chest == 2 == true then
  48. term.clear()
  49. term.setCursorPos(1, 1)
  50. print("CHEST: OFF")
  51. end
  52. sleep(0.75)
  53. term.clear()
  54. term.setCursorPos(1, 1)
  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. print("Mining Blocks: ",block)
  65. print("Mined Blocks: ",score)
  66. mineblock = mineblock + 1
  67. mine2.mine()
  68. mine.bridge()
  69. score = score +1
  70. score = score+1
  71. term.clear()
  72. term.setCursorPos(1, 1)
  73. print("Mining Blocks: ",block)
  74. print("Mined Blocks: ",score)
  75. mineblock = mineblock + 1
  76. mine2.mine()
  77. mine.bridge()
  78. score = score +1
  79. score = score+1
  80. term.clear()
  81. term.setCursorPos(1, 1)
  82. print("Mining Blocks: ",block)
  83. print("Mined Blocks: ",score)
  84. mineblock = mineblock + 1
  85. if mineblock > 6 == true then
  86. mine3.torch()
  87. mineblock = 0
  88. end
  89. turtle.turnLeft()
  90. for i=1,input2 do
  91. mine2.mine()
  92. mine.bridge()
  93. score = score +1
  94. score = score+1
  95. term.clear()
  96. term.setCursorPos(1, 1)
  97. print("Mining Blocks: ",block)
  98. print("Mined Blocks: ",score)
  99. end
  100. turtle.turnLeft()
  101. turtle.turnLeft()
  102. for i =1,input2 do
  103. mine2.mine()
  104. end
  105. for i=1,input2 do
  106. mine2.mine()
  107. mine.bridge()
  108. score = score +1
  109. score = score+1
  110. term.clear()
  111. term.setCursorPos(1, 1)
  112. print("Mining Blocks: ",block)
  113. print("Mined Blocks: ",score)
  114. end
  115. turtle.turnLeft()
  116. turtle.turnLeft()
  117. for i =1,input2 do
  118. mine2.mine()
  119. end
  120. distance = distance + 1
  121. h = fs.open("/stripmineprogramm/number","w")
  122. h.write(distance)
  123. h.close()
  124. turtle.turnRight()
  125. if chest == 1 == true then
  126. mine3.check()
  127. end
  128.  
  129. end
  130. if chest == 1 == true then
  131. turtle.turnLeft()
  132. turtle.turnLeft()
  133. turtle.up()
  134. te = input1*3
  135. for i = 1,te do
  136. mine2.mine2()
  137. end
  138. turtle.down()
  139. mine.clear()
  140. end
Add Comment
Please, Sign In to add comment