Advertisement
Guest User

Final

a guest
Jun 24th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.23 KB | None | 0 0
  1. function RightMine()
  2.     turtle.turnRight()
  3.     turtle.dig()
  4.     turtle.forward()
  5.     turtle.turnRight()
  6. end
  7.  
  8. function LeftMine()
  9.     turtle.turnLeft()
  10.     turtle.dig()
  11.     turtle.forward()
  12.     turtle.turnLeft()
  13. end
  14.  
  15. function RightPlant()
  16.     turtle.turnRight()
  17.     turtle.back()
  18.     turtle.place()
  19.     turtle.turnRight()
  20. end
  21.  
  22. function LeftPlant()
  23.     turtle.turnLeft()
  24.     turtle.back()
  25.     turtle.place()
  26.     turtle.turnLeft()
  27. end
  28.  
  29. function Mine()
  30.     turtle.select(1)
  31.     turtle.dig()
  32.     turtle.forward()
  33.     for i=1, 9 do
  34.         for i=1, 8 do
  35.             for j=0,7 do
  36.                 turtle.dig()
  37.                 turtle.forward()
  38.             end
  39.             if i < 8 then
  40.                 if i % 2 == 0 then
  41.                     LeftMine()
  42.                 else
  43.                     RightMine()
  44.                 end
  45.             end
  46.         end
  47.         if i < 9 then
  48.             turtle.digUp()
  49.             turtle.up()
  50.             turtle.turnRight()
  51.         end
  52.     end
  53.     MineHome()
  54. end
  55.  
  56. function MineHome()
  57.     turtle.forward()
  58.     for i=0, 8 do
  59.         if i < 8 then
  60.             turtle.digDown()
  61.             turtle.down()
  62.         else
  63.         turtle.down()
  64.         end  
  65.     end
  66.     turtle.turnRight()
  67.     for i=0, 6 do
  68.         turtle.forward()
  69.     end
  70.     turtle.turnLeft()
  71.     turtle.back()
  72.     Plant()
  73. end
  74.  
  75. function Plant()
  76.     for i=1, 8 do
  77.         for j=0,7 do
  78.         if turtle.getItemCount() < 3 then
  79.             turtle.select(turtle.getSelectedSlot() + 1)
  80.             end
  81.             turtle.back()
  82.             turtle.place()
  83.         end
  84.         if i < 8 then
  85.             if i % 2 == 0 then
  86.                 LeftPlant()
  87.             else
  88.                 RightPlant()
  89.             end
  90.         end
  91.     end
  92.     turtle.back()
  93.     turtle.place()
  94.     PlantHome()
  95. end
  96.  
  97. function PlantHome()
  98.     turtle.turnRight()
  99.     for i=0, 6 do
  100.         turtle.back()
  101.     end
  102.     turtle.turnRight()
  103.     Transfer()
  104. end
  105.  
  106. function Transfer()
  107.     for i=9, 16 do
  108.         turtle.select(i)
  109.         turtle.drop(turtle.getItemCount() - 1)
  110.     end
  111.     turtle.select(1)
  112.     turtle.turnRight()
  113.     turtle.turnRight()
  114. end
  115. while true do
  116.     if not turtle.compare() then
  117.     Mine()
  118.     end
  119. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement