SHARE
TWEET

mine.lua

a guest Aug 21st, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. maxdigs = 8
  2. currentdigs = 0
  3. function refuel()
  4. print("Checking Fuel Gauage")
  5. if turtle.getFuelLevel() < 20 then
  6. for i=1,1 do
  7. print("Getting Fuel....")
  8. turtle.select(1)
  9. f = turtle.refuel(1)
  10. if f == false then
  11. for i=1,16 do
  12. turtle.select(i)
  13. if turtle.getItemDetail()["name"]:find("planks") then
  14. turtle.transferTo(1, 64)
  15. end
  16. end
  17. while turtle.refuel(1) == false do
  18. lll = 5
  19. for i=1,25 do
  20. lll = lll + 5
  21. end
  22. print("waiting for a refuel")
  23. end
  24. end
  25. end
  26. else
  27. print("Fuel is not needed, carrying on with duties.")
  28. end
  29. end
  30.  
  31. function mine()
  32. for i=1,16 do
  33. turtle.dig()
  34. for i=1,4 do
  35. turtle.dig()
  36. turtle.up()
  37. end
  38. for i=1,4 do
  39. turtle.down()
  40. end
  41. turtle.forward()
  42. refuel()
  43. end
  44. turtle.back()
  45. turtle.select(2)
  46. turtle.place()
  47. turtle.select(1)
  48. for i=1,16 do
  49. turtle.back()
  50. refuel()
  51. end
  52. store()
  53. end
  54.  
  55. -- 6
  56. function store()
  57. turtle.select(2)
  58. turtle.turnRight()
  59. turtle.place()
  60. turtle.select(1)
  61. turtle.turnLeft()
  62. for i=1,6 do
  63. turtle.forward()
  64. end
  65. turtle.turnRight()
  66. while turtle.detect() ~= true do
  67. turtle.forward()
  68. end
  69. for i=1,16 do
  70. if i > 2 then
  71. turtle.select(i)
  72. turtle.drop(64)
  73. else
  74. print("cant store this one")
  75. end
  76. end
  77.  
  78. for i=1,2 do
  79. turtle.turnRight()
  80. end
  81. while turtle.detect() ~= true do
  82. print("Nothing infront continuing")
  83. turtle.forward()
  84. end
  85. turtle.turnLeft()
  86. for i=1,6 do
  87. turtle.forward()
  88. end
  89. turtle.turnRight()
  90. if currentdigs < maxdigs then
  91. currentdigs = currentdigs + 1
  92. startmine()
  93. end
  94.  
  95. end
  96.  
  97. function startmine()
  98. turtle.dig()
  99. for i=1,3 do
  100. turtle.dig()
  101. turtle.up()
  102. end
  103. for i=1,3 do
  104. turtle.down()
  105. end
  106. turtle.forward()
  107. turtle.turnRight()
  108. refuel()
  109. mine()
  110. end
  111.  
  112. store()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top