RandomShovel

[CC] Branch Mining Program [Chest Compatible]

Dec 16th, 2012
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.37 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1, 1)
  3. print("Place torches in slot 1!")
  4. print("Place blocks in slot 2!")
  5. print("Don't use wood in slot 2!")
  6. print("Every number counts as 8!")
  7. print("Example ____ 8 =a 64 tunnel in length!")
  8. sleep(2)
  9.  
  10. local tArgs = { ... }
  11.  
  12. if #tArgs ~= 1 then
  13.  print("Usage: BranchMining <length>")
  14. end
  15.  
  16. local times = 0
  17. l = tArgs[1]
  18.  
  19. for k=1, l do
  20.  for i=1,8 do
  21.   term.clear()
  22.   term.setCursorPos(1, 1)
  23.   Fuel = turtle.getFuelLevel()
  24.   print("Fuel Left: "..Fuel)
  25.   if turtle.getFuelLevel() < 100 then
  26.    for i=1,16 do
  27.     turtle.select(i)
  28.     turtle.refuel()
  29.    end
  30.  end
  31.  
  32.     turtle.detectUp()
  33.   if turtle.detectUp() == true then
  34.   repeat
  35.   turtle.digUp()
  36.   sleep(0.55)
  37.   until turtle.detectUp() == false
  38.  end
  39.  
  40.  
  41. print("")
  42. print("Length Completed: "..i)
  43. print("")
  44. print("Blocks Dug: "..i*2)
  45. print("")
  46. print("Torches Are Not Fixed In This Version!")
  47. print("")
  48.  
  49. turtle.detectDown()
  50.   if turtle.detectDown() == false then
  51.   repeat
  52.   turtle.dig()
  53.   sleep(0.55)
  54.   until turtle.detect() == false
  55.  end
  56.  
  57.   turtle.detectDown()
  58.   if turtle.detectDown() == false then
  59.   repeat
  60.   turtle.select(2)
  61.   turtle.placeDown()
  62.   sleep(.55)
  63.   until turtle.detectDown() == true
  64. end
  65.  
  66. turtle.turnLeft()
  67.  if turtle.detect() == false then
  68.   for i=2,16 do
  69.   turtle.select(i)
  70.   turtle.place()
  71.  end
  72. end
  73.  
  74. turtle.turnRight()
  75. turtle.turnRight()
  76.  
  77. if turtle.detect() == false then
  78. for i=2,16 do
  79.  turtle.select(i)
  80.  turtle.place()
  81. end
  82. end
  83.  
  84. turtle.turnLeft()
  85.  
  86. turtle.up()
  87. if turtle.detectUp() == false then
  88. for i=2,16 do
  89.  turtle.select(i)
  90.  turtle.placeUp()
  91. end
  92. end
  93.  
  94. turtle.turnLeft()
  95. if turtle.detect() == false then
  96. for i=2,16 do
  97.  turtle.select(i)
  98.  turtle.place()
  99. end
  100. end
  101.  
  102. turtle.turnRight()
  103. turtle.turnRight()
  104.  
  105. if turtle.detect() == false then
  106.  for i=2,16 do
  107.   turtle.select(i)
  108.   turtle.place()
  109.  end
  110. end
  111.  
  112. turtle.turnLeft()
  113. turtle.down()
  114.  
  115. if i == 8 then
  116.  turtle.select(1)
  117.  turtle.placeUp()
  118. end
  119.  
  120. if i == 8 then
  121. term.clear()
  122. term.setCursorPos(1, 1)
  123. print("I have finished a 8 long tunnel segment!")
  124. end
  125.  
  126.   turtle.detect()
  127.   if turtle.detect() == true then
  128.     turtle.dig()
  129.   else
  130.    if turtle.detect() == false then
  131.     turtle.forward()
  132.    end
  133.   end
  134.  end
  135. end
  136. turtle.digUp()
  137.  
  138. turtle.turnLeft()
  139. turtle.turnLeft()
  140.  
  141. for i=1, l do
  142.   turtle.forward()
  143. end
  144.  
  145. for i=1,16 do
  146.   turtle.select(i)
  147.   turtle.drop()
  148. end
Advertisement
Add Comment
Please, Sign In to add comment