emagiannu

Gomma

Feb 1st, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. alt=0
  2. giri=0
  3.  
  4. function scarica()
  5.         print( "Scarico.." )
  6.         for i=2,16 do
  7.                 turtle.select(i)
  8.                 turtle.drop()
  9.         end
  10.         turtle.select(1)
  11. end
  12.  
  13. if(turtle.getItemCount(1)==0) then
  14.   print("Metti Legno di Gomma")
  15. else
  16. turtle.select(1)
  17. while not turtle.compare() do
  18.    turtle.select(1)
  19.     turtle.turnRight()
  20.     giri=giri+1
  21.     if (giri==4) then
  22.       print("Nessun albero rilevato")
  23.       return
  24.     end
  25. end
  26.  
  27. for i=0, 3 do
  28.   select(1)
  29.   while turtle.compare() do
  30.     turtle.dig()
  31.     turtle.up()
  32.     alt=alt+1
  33.   end
  34.   for i=0, alt do
  35.     turtle.down()
  36.   end
  37.   turtle.turnRight()
  38.   turtle.forward()
  39.   turtle.forward()
  40.   turtle.turnLeft()
  41.   turtle.forward()
  42.   turtle.turnLeft()
  43. end
  44.  
  45. turtle.turnRight()
  46. turtle.turnRight()
  47. scarica()
  48. turtle.turnRight()
  49. turtle.turnRight()
  50. end
Advertisement
Add Comment
Please, Sign In to add comment