Guest User

Untitled

a guest
Aug 20th, 2019
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function line()
  3. for i=1, 200 do
  4. turtle.dig()
  5. turtle.forward()
  6. turtle.digUp()
  7. end
  8. end
  9.  
  10. function goShaftWidth(n)
  11. for j = 1, n do
  12. for i = 1,4 do
  13. turtle.forward()
  14. end
  15. end
  16. end
  17.  
  18. function digShaftWidth(n)
  19. for j = 1, n do
  20. for i = 1,4 do
  21. turtle.dig()
  22. turtle.forward()
  23. turtle.digUp()
  24. end
  25. end
  26. end
  27.  
  28. function itemIs(name)
  29. if (turtle.getItemDetail() and turtle.getItemDetail().name == ("minecraft:" .. name)) then
  30. return true
  31. else
  32. return false
  33. end
  34. end
  35.  
  36. function refuel()
  37. if (turtle.getFuelLevel() < 500) then
  38. for i=1,16 do
  39. turtle.select(i)
  40. if (itemIs("coal")) then
  41. turtle.refuel()
  42. end
  43. end
  44. end
  45. end
  46.  
  47. function dropOff()
  48. if (turtle.getFuelLevel() < 500) then
  49. for i=1,16 do
  50. turtle.select(i)
  51. if (itemIs("coal")) then
  52. turtle.refuel()
  53. else
  54. turtle.drop()
  55. end
  56. end
  57. else
  58. for i=1,16 do
  59. turtle.select(i)
  60. if (itemIs("coal")) then
  61. turtle.drop(32)
  62. else
  63. turtle.drop()
  64. end
  65. end
  66. end
  67. end
  68.  
  69. function stripMine()
  70. for i=1,10 do
  71. if (i == 1) then
  72. refuel()
  73. elseif (i > 1) then
  74. turtle.turnRight()
  75. digShaftWidth(2*(i-1))
  76. turtle.turnLeft()
  77. end
  78. line()
  79. turtle.turnRight()
  80. digShaftWidth(1)
  81. turtle.turnRight()
  82. line()
  83. turtle.turnRight()
  84. digShaftWidth(2*i - 1)
  85. turtle.turnLeft()
  86. dropOff()
  87. turtle.turnLeft()
  88. turtle.turnLeft()
  89. end
  90. end
  91.  
  92. stripMine()
RAW Paste Data