Ferruccioboss

Minecraft>WheatTurtle

May 24th, 2015
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.25 KB | None | 0 0
  1. function moveForward()
  2.     while not turtle.forward() do
  3.     end
  4. end
  5.  
  6. function moveUp()
  7.     while not turtle.up() do
  8.     end
  9. end
  10.  
  11. function moveDown()
  12.     while not turtle.down() do
  13.     end
  14. end
  15.  
  16. local function campoGrano(numero)
  17.     if numero == 0 or numero == 1 or numero == 2 or numero == 7 or numero == 8 or numero == 9 then
  18.     turtle.select(1)
  19.     elseif numero == 3 or numero == 4 then
  20.     turtle.select(2)
  21.     elseif numero == 5 or numero == 6 then
  22.     turtle.select(3)
  23.     end
  24.     for c1=0, 3, 1 do
  25.         for c2=0, 7, 1 do
  26.             turtle.digDown()
  27.             turtle.placeDown()
  28.             if c2~=7 then
  29.                 moveForward()
  30.             end
  31.         end
  32.         if c1~=3 then
  33.             if c1==0 or c1==2 then
  34.                 turtle.turnLeft()
  35.                 moveForward()
  36.                 turtle.turnLeft()
  37.             elseif c1==1 then
  38.                 turtle.turnRight()
  39.                 moveForward()
  40.                 turtle.turnRight()
  41.             end
  42.         end
  43.     end
  44. end
  45.  
  46. local function transizione1()
  47.     turtle.turnRight()
  48.     for c1=0, 1, 1 do
  49.         moveForward()
  50.     end
  51.     turtle.turnRight()
  52. end
  53.  
  54. local function transizione2()
  55.     turtle.turnRight()
  56.     for c1=0, 2, 1 do
  57.         moveUp()
  58.     end
  59.     for c1=0, 3, 1 do
  60.         moveForward()
  61.     end
  62.     for c1=0, 2, 1 do
  63.         moveDown()
  64.     end
  65.     turtle.turnRight()
  66. end
  67.  
  68. local function transizione3()
  69.     for c1=0, 2, 1 do
  70.         moveUp()
  71.     end
  72.     for c1=0, 3, 1 do
  73.         moveForward()
  74.     end
  75.     for c1=0, 2, 1 do
  76.         moveDown()
  77.     end
  78. end
  79.  
  80. local function startF()
  81.     turtle.turnLeft()
  82.     for c=1, 3, 1 do
  83.         turtle.select(c)
  84.         turtle.suck()
  85.     end
  86.     turtle.turnRight()
  87.     for c1=0, 2, 1 do
  88.         moveUp()
  89.     end
  90.     for c1=0, 1, 1 do
  91.         moveForward()
  92.     end
  93.     turtle.turnRight()
  94.     moveForward()
  95.     for c1=0, 2, 1 do
  96.         moveDown()
  97.     end
  98. end
  99.  
  100. local function endF()
  101.     for c1=0, 2, 1 do
  102.         moveUp()
  103.     end
  104.     for c1=0, 2, 1 do
  105.         moveForward()
  106.     end
  107.     turtle.turnRight()
  108.     for c1=0, 1, 1 do
  109.         moveForward()
  110.     end
  111.     for c1=0, 2, 1 do
  112.         moveDown()
  113.     end
  114.     turtle.turnRight()
  115.     for c=1, 16, 1 do
  116.     turtle.select(c)
  117.     turtle.drop()
  118.     end
  119.     turtle.turnRight()
  120. end
  121.  
  122. if turtle.getFuelLevel() > 100 then
  123.     for c1=0, 9, 1 do
  124.         if c1==0 then
  125.             startF()
  126.         end
  127.         campoGrano(c1)
  128.         if c1==1 or c1==3 or c1==5 or c1==7 then
  129.             transizione1()
  130.         end
  131.         if c1==0 or c1==2 or c1==6 or c1==8 then
  132.             transizione2()
  133.         end
  134.         if  c1==4 then
  135.             transizione3()
  136.         end
  137.         if c1==9 then
  138.             endF()
  139.         end
  140.     end
  141. else
  142. print("Too low fuel!")
  143. end
Advertisement
Add Comment
Please, Sign In to add comment