Advertisement
Megaddd

minecraft Pillar/wall digger turtle

Jul 17th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. args = {...}
  2. height = args[1]
  3. length = args[2]
  4.  
  5. function checkfuel()
  6. if turtle.getFuelLevel() <= 4 then
  7. turtle.select(16)
  8. turtle.refuel(1)
  9. turtle.select(1)
  10. end
  11. end
  12.  
  13. function dig()
  14. while turtle.detect() do
  15. turtle.dig()
  16. os.sleep(.5)
  17. end
  18. end
  19.  
  20. function digUp()
  21. while turtle.detectUp() do
  22. turtle.digUp()
  23. os.sleep(.5)
  24. end
  25. end
  26.  
  27. function digDown()
  28. while turtle.detectDown() do
  29. turtle.digDown()
  30. os.sleep(.5)
  31. end
  32. end
  33.  
  34. function forward()
  35. checkfuel()
  36. while turtle.forward() == false do
  37. dig()
  38. turtle.attack()
  39. checkfuel()
  40. os.sleep(.5)
  41. end
  42. end
  43.  
  44. function up()
  45. checkfuel()
  46. while turtle.up() == false do
  47. digUp()
  48. turtle.attackUp()
  49. checkfuel()
  50. os.sleep(.5)
  51. end
  52. end
  53.  
  54. function down()
  55. checkfuel()
  56. while turtle.down() == false do
  57. digDown()
  58. turtle.attackDown()
  59. checkfuel()
  60. os.sleep(.5)
  61. end
  62. end
  63.  
  64. function pillar(hi,le)
  65. for i=1,le do
  66. forward()
  67. for o=1,hi-1 do
  68. if i % 2 == 1 then
  69. up()
  70. else
  71. down()
  72. end
  73. end
  74. end
  75. if le % 2 == 1 then
  76. for i=1,hi do
  77. down()
  78. end
  79. end
  80. end
  81.  
  82. pillar(height,length)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement