Advertisement
RasmusStagsted

Untitled

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