Advertisement
koriar

StripMine

Nov 20th, 2021 (edited)
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. local tArgs = { ... }
  2.  
  3. branches = 4
  4.  
  5. function refuel( ammount )
  6. return true
  7. end
  8.  
  9.  
  10. local function tryUp()
  11. if not refuel() then
  12. print( "Not enough Fuel" )
  13. end
  14.  
  15. while not turtle.up() do
  16. if turtle.detectUp() then
  17. if turtle.digUp() then
  18. if not collect() then
  19. print( "Up OK" )
  20. end
  21. else
  22. return false
  23. end
  24. elseif turtle.attack() then
  25. if not collect() then
  26. end
  27. else
  28. sleep( 0.5 )
  29. end
  30. end
  31.  
  32. return true
  33. end
  34.  
  35. local function tryForwards()
  36. if not refuel() then
  37. print( "Not enough Fuel" )
  38. end
  39.  
  40. while not turtle.forward() do
  41. if turtle.detect() then
  42. if turtle.dig() then
  43. if not collect() then
  44. end
  45. else
  46. return false
  47. end
  48. elseif turtle.attack() then
  49. if not collect() then
  50. end
  51. else
  52. sleep( 0.5 )
  53. end
  54. end
  55.  
  56. return true
  57. end
  58.  
  59. local function digbranch()
  60. shell.run("digtunnel",tArgs[1])
  61. tryUp()
  62. shell.run("digtunnel",tArgs[1])
  63. while turtle.down() do
  64. sleep(0.1)
  65. end
  66. end
  67.  
  68. while branches > 0 do
  69. digbranch()
  70. turtle.turnRight()
  71. tryForwards()
  72. tryForwards()
  73. tryForwards()
  74. turtle.turnLeft()
  75. branches = branches - 1
  76. end
  77.  
  78.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement