Mining turtle - ComputerCraft FTB Minecraft


SUBMITTED BY: Guest

DATE: June 11, 2015, 4:56 p.m.

FORMAT: Lua

SIZE: 2.4 kB

HITS: 546

  1. turtle.select(1)
  2. write ("Enter the area size: ")
  3. local mainloo = read()
  4. local mainloop = tonumber(mainloo)
  5. print ("Selected area is: ",mainloo,"x",mainloo)
  6. write ("How deep do you want to dig? ")
  7. local deep = read()
  8. local depth = tonumber(deep)
  9. local num1 = 0
  10. local volume = ((mainloop*mainloop*depth)-depth)
  11. print("The total volume is :",volume," blocks")
  12. while (num1 < depth) do
  13. turtle.select(1)
  14. local loop4 = 2
  15. local limiter = 3
  16. while (loop4 < mainloop)
  17. do
  18. local bigloop = 0
  19. while (bigloop < 4)
  20. do
  21. local length = limiter
  22. local loop = 1
  23. turtle.turnLeft()
  24. while (loop < length)
  25. do
  26. while (turtle.detect())
  27. do
  28. turtle.dig()
  29. end
  30. turtle.forward()
  31. loop = loop + 1
  32. end
  33. bigloop = bigloop + 1
  34. end
  35. local slots = 17
  36. local loop2 = 1
  37. while (loop2 <slots)
  38. do
  39. turtle.select(loop2)
  40. turtle.drop()
  41. loop2 = loop2+1
  42. end
  43. if(turtle.getFuelLevel() < 50000)
  44. then
  45. turtle.turnRight()
  46. turtle.select(1)
  47. turtle.suck()
  48. turtle.refuel()
  49. turtle.turnLeft()
  50. end
  51. local level = turtle.getFuelLevel()
  52. local limit = turtle.getFuelLimit()
  53. print ("Fuel: ",level,"/",limit)
  54. limiter = limiter+1
  55. loop4 = loop4+1
  56. end
  57. turtle.select(1)
  58. turtle.dig()
  59. turtle.turnRight()
  60. turtle.select(2)
  61. turtle.dig()
  62. turtle.turnLeft()
  63. turtle.digDown()
  64. turtle.down()
  65. turtle.dig()
  66. turtle.select(1)
  67. turtle.place()
  68. turtle.turnRight()
  69. turtle.dig()
  70. turtle.select(2)
  71. turtle.dig()
  72. turtle.place()
  73. turtle.turnLeft()
  74. local looper = 1
  75. while (looper < 17)
  76. do
  77. turtle.select(looper)
  78. turtle.drop()
  79. looper = looper+1
  80. end
  81. num1 = num1 +1
  82. end
  83. print ("Finished")
  84. local looping = 0
  85. while (looping < depth)
  86. do
  87. turtle.up()
  88. looping = looping +1
  89. end
  90. turtle.select(1)
  91. turtle.suckUp()
  92. turtle.place()
  93. turtle.turnLeft()
  94. turtle.forward()
  95. turtle.forward()
  96. turtle.select(2)
  97. turtle.suckUp()
  98. turtle.turnRight()
  99. looping = 0
  100. while (looping < depth)
  101. do
  102. turtle.dig()
  103. turtle.place()
  104. turtle.down()
  105. looping = looping+1
  106. end
  107. turtle.turnRight()
  108. turtle.forward()
  109. turtle.forward()
  110. turtle.turnLeft()

comments powered by Disqus