Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. inp = 0
  2. local main = 1
  3. if turtle.getItemDetail(16) == false then
  4. print("No chest in slot 16")
  5. else
  6. print("Chest detected")
  7. chest = turtle.getItemDetail(16)["name"]
  8. end
  9. local function aboutface()
  10. turtle.turnLeft()
  11. turtle.turnLeft()
  12. end
  13.  
  14. local function placetorch()
  15. if turtle.getItemCount(15) > 0 then
  16. aboutface()
  17. turtle.select(15)
  18. turtle.place()
  19. aboutface()
  20. turtle.select(1)
  21. else
  22. print("No torches")
  23. end
  24. end
  25.  
  26.  
  27.  
  28. local function itemdump()
  29. if turtle.getItemCount(14) > 0 or main == 0 then
  30. turtle.up()
  31. aboutface()
  32. local b, t =turtle.inspectDown()
  33. while t.name ~= chest do
  34. if t.name ~= chest then
  35. turtle.forward()
  36. end
  37. b,t = turtle.inspectDown()
  38. end
  39. for x=1,14 do
  40. turtle.select(x)
  41. turtle.dropDown()
  42. end
  43. turtle.select(1)
  44. if main > 0 then
  45. aboutface()
  46. while turtle.inspect() == false do
  47. turtle.forward()
  48. end
  49. turtle.digDown()
  50. turtle.down()
  51. end
  52. end
  53. end
  54. local function digcheck()
  55. if turtle.inspect() then
  56. turtle.dig()
  57. digcheck()
  58. end
  59. end
  60.  
  61. local function digsides()
  62. turtle.turnRight()
  63. digcheck()
  64. aboutface()
  65. digcheck()
  66. turtle.turnRight()
  67. end
  68.  
  69. local function digwall()
  70. for x=1,2 do
  71. turtle.up()
  72. end
  73. digcheck()
  74. turtle.forward()
  75. digsides()
  76. for x = 1, 2 do
  77. turtle.digDown()
  78. turtle.down()
  79. digsides()
  80. end
  81. end
  82.  
  83. inp = io.read()
  84. for x = 1,inp do
  85. digwall()
  86. print(x)
  87. if (x%7) == 0 then
  88. placetorch()
  89. else if x == 1 then
  90. aboutface()
  91. turtle.select(16)
  92. turtle.place()
  93. aboutface()
  94. end
  95. itemdump()
  96. end
  97. main = 0
  98. itemdump()
  99. print("Mining done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement