Advertisement
wolfdale276

Mining Turtle with Ender Chest

Apr 5th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Strip mining turtle program with enderchest.
  2. --Start this program after its finished: http://pastebin.com/SzytbMqB
  3. --Credit for this script goes to:
  4. --Gabriel *******(Spirr0u)
  5. --I saved to my pastebin so I can easily find it. :) Thank you.
  6.  
  7.  
  8. function checkFuel()
  9.   while turtle.getFuelLevel() <= 50 do
  10.     turtle.select(15)
  11.     turtle.refuel(1)
  12.     turtle.select(1)
  13.   end
  14. end
  15.  
  16. function forward()
  17.   while turtle.detect() do
  18.     turtle.dig()
  19.     sleep(0.5)
  20.   end
  21.   while turtle.detectUp() do
  22.     turtle.digUp()
  23.     sleep(0.5)
  24.   end
  25.   if turtle.detectDown() then
  26.     turtle.forward()
  27.   else
  28.     turtle.select(1)
  29.     turtle.placeDown()
  30.     turtle.forward()
  31.   end
  32. end
  33.  
  34. function turnAround()
  35.   turtle.turnRight()
  36.   turtle.turnRight()
  37. end
  38.  
  39. function back()
  40.   while turtle.detectUp() do
  41.     turtle.digUp()
  42.     sleep(0.5)
  43.   end
  44.   turtle.up()
  45.   turnAround()
  46.   while tunnellength > 0 do
  47.     while turtle.detect() do
  48.       turtle.dig()
  49.       sleep(1)
  50.     end
  51.     turtle.forward()
  52.     tunnellength = tunnellength - 1
  53.   end
  54.   turtle.digDown()
  55.   turtle.down()
  56. end
  57.  
  58. function chest()
  59.   turtle.select(14)
  60.   while turtle.detect() do
  61.     turtle.dig()
  62.     sleep(0.5)
  63.   end
  64.   turtle.dig()
  65.   turtle.place()
  66.   turtle.select(2)
  67.   turtle.drop()
  68.   turtle.select(3)
  69.   turtle.drop()
  70.   turtle.select(4)
  71.   turtle.drop()
  72.   turtle.select(5)
  73.   turtle.drop()
  74.   turtle.select(6)
  75.   turtle.drop()
  76.   turtle.select(7)
  77.   turtle.drop()
  78.   turtle.select(8)
  79.   turtle.drop()
  80.   turtle.select(9)
  81.   turtle.drop()
  82.   turtle.select(10)
  83.   turtle.drop()
  84.   turtle.select(11)
  85.   turtle.drop()
  86.   turtle.select(12)
  87.   turtle.drop()
  88.   turtle.select(13)
  89.   turtle.drop()
  90.   turtle.select(14)
  91.   turtle.dig()
  92.   turtle.select(1)
  93. end
  94.  
  95. --Main script
  96. print("Cobblestone in slot 1, enderchest in slot 14, fuel in slot 15, torches in slot 16.")
  97. print("Input total mines:")
  98. abzweigungen = io.read()
  99. abzweigungen = abzweigungen +0
  100. z = 0
  101. tunnellength = abzweigungen*3
  102.  
  103. print("mines : ")
  104. print("0")
  105. while abzweigungen > 0 do
  106.   x = 0
  107.   y = 0
  108.   checkFuel()
  109.   forward()
  110.   turnAround()
  111.   chest()
  112.   turnAround()
  113.   forward()
  114.   turtle.turnLeft()
  115.   forward()
  116.   forward()
  117.   forward()
  118.   forward()
  119.   forward()
  120.   forward()
  121.   while turtle.detectUp() do
  122.     turtle.digUp()
  123.     sleep(0.5)
  124.   end
  125.   turnAround()
  126.   while x < 12 do
  127.     forward()
  128.     x= x + 1
  129.     sleep(0.1)
  130.   end
  131.   while turtle.detectUp() do
  132.     turtle.digUp()
  133.     sleep(0.1)
  134.   end
  135.   turnAround()
  136.   while y < 6 do
  137.     forward()
  138.     y = y + 1
  139.     sleep(0.1)
  140.   end
  141.   while turtle.detectUp() do
  142.     turtle.digUp()
  143.     sleep(0.5)
  144.   end
  145.   turtle.turnRight()
  146.   while turtle.detect() do
  147.     turtle.dig()
  148.     sleep(0.5)
  149.   end
  150.   turtle.forward()
  151.   turnAround()
  152.   turtle.select(16)
  153.   while turtle.detect() do
  154.     turtle.dig()
  155.     sleep(0.5)
  156.   end  
  157.   turtle.place()
  158.   turnAround()
  159.  
  160.   z = z + 1
  161.   print(z)
  162.   abzweigungen = abzweigungen - 1
  163. end
  164. print("Go back")
  165. back()
  166. print("Finish")
  167. print("Now you can start the nextmine program.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement