Advertisement
Guest User

sposta

a guest
May 30th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. -- vai avanti fino al blocco
  2. -- al blocco gira a sinistra
  3. -- turna indietro
  4.  
  5. function vaiAvanti()
  6.     for i = 1,3 do
  7.         turtle.select(i)
  8.         turtle.suck()
  9.     end
  10.     if turtle.getItemCount(1) > 0 then
  11.         turtle.turnLeft()
  12.         turtle.turnLeft()
  13.         while not turtle.detect() do
  14.             turtle.forward()
  15.             if turtle.detect() then
  16.                 turtle.turnLeft()
  17.                 while not turtle.detect() do
  18.                     turtle.forward()
  19.                     if turtle.detect() then
  20.                         turtle.select(1)
  21.                         turtle.drop()
  22.                         turtle.select(2)
  23.                         turtle.drop()
  24.                         turtle.select(3)
  25.                         turtle.drop()
  26.                         turtle.turnRight()
  27.                         turtle.turnRight()
  28.                         while not turtle.detect() do
  29.                             turtle.forward()
  30.                             if turtle.detect() then
  31.                                 turtle.turnRight()
  32.                                 while not turtle.detect() do
  33.                                     turtle.forward()
  34.                                 end
  35.                             end
  36.                         end
  37.                     end
  38.                 end
  39.             end
  40.         end
  41.     end
  42.    
  43. end
  44. while true do
  45.     vaiAvanti()
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement