Advertisement
Guest User

chop.lua

a guest
Apr 3rd, 2020
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.54 KB | None | 0 0
  1. function suckRow(count)
  2.     if count == nil then
  3.         count = 1
  4.     end
  5.     for i = 1, count do
  6.         if not i == 1 then
  7.             while not turtle.forward() do
  8.                 turtle.dig()
  9.             end
  10.         end
  11.         turtle.suck()
  12.     end
  13. end
  14.  
  15. function left()
  16.     turtle.turnLeft()
  17. end
  18.    
  19. function right()
  20.     turtle.turnRight()
  21. end
  22.  
  23. function up(count)
  24.     if count == nil then
  25.         count = 1
  26.     end
  27.     for i = 1, count do
  28.         while not turtle.up() do
  29.             turtle.digUp()
  30.         end
  31.     end
  32. end
  33.  
  34. function down(count)
  35.     if count == nil then
  36.         count = 1
  37.     end
  38.     for i = 1, count do
  39.         while not turtle.down() do
  40.             turtle.digDown()
  41.         end
  42.     end
  43. end
  44.  
  45. function forward(count)
  46.     if count == nil then
  47.         count =  1
  48.     end
  49.     for i = 1, count do
  50.         while not turtle.forward() do
  51.             turtle.dig()
  52.         end
  53.     end
  54. end
  55.  
  56. function chop()
  57.     up(count)
  58.     down(count)
  59. end
  60.  
  61. function chopRow(length, height, count)
  62.     for i = 1, count do
  63.         if not count == 1 then
  64.             forwasrd(length)
  65.         end
  66.         up(height)
  67.         down(height)
  68.     end
  69. end
  70.  
  71. forward(1)
  72. chopRow(4, 6, 3)
  73. left()
  74. forward(length)
  75. left()
  76. chopRow(4, 6, 3)
  77. right()
  78. forward(length)
  79. right()
  80. chopRow(4, 6, 3)
  81. forward(2)
  82. left()
  83. forward(2)
  84. left()
  85. for i = 1, 6 do
  86.     suckRow(13)
  87.     left()
  88.     suckRow(1)
  89.     left()
  90.     suckRow(13)
  91.     right()
  92.     suckRow(1)
  93.     right()
  94. end
  95. suckRow(13)
  96. right()
  97. forward(2)
  98. right()
  99. forward(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement