Advertisement
Wylbo

Ferme a arbre

Nov 2nd, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. --Derriere rangement. droite sapling. gauche coal. dessou Bonemeal
  2.  
  3. function place() --place la pousse
  4.     turtle.select(1)
  5.     turtle.place()
  6.     turtle.select(2)
  7.       for p = 1, 5 do
  8.         turtle.place()
  9.       end
  10. end
  11.  
  12. function coupe() --coupe l'arbre
  13.     turtle.dig()
  14.     turtle.forward()
  15.    
  16.     while turtle.detectUp() do
  17.         turtle.digUp()
  18.         turtle.up()
  19.     end
  20.    
  21.     while not turtle.detectDown() do
  22.         turtle.down()
  23.     end
  24.     turtle.back()
  25. end
  26.  
  27. function stockCoal()
  28.     turtle.turnLeft()
  29.     if turtle.getItemCount(16) < 5 then
  30.         turtle.select(16)
  31.         turtle.suck(10)
  32.     end
  33.     turtle.turnLeft()
  34. end
  35.    
  36. function range()
  37.     turtle.turnLeft()
  38.     for r = 3, 15 do
  39.         turtle.select(r)
  40.         turtle.drop()
  41.     end
  42. end
  43.  
  44. function stockSapling()
  45.     if turtle.getItemCount(1) < 5 then
  46.         turtle.select(1)
  47.         turtle.suckDown(10)
  48.     end
  49. end
  50.  
  51. function stockBonemeal()
  52.     turtle.turnLeft()
  53.     if turtle.getItemCount(2) < 5 then
  54.         turtle.select(2)
  55.         turtle.suck(5)
  56.     end
  57. end
  58. while true do
  59.     if turtle.getFuelLevel() < 50 then
  60.         turtle.select(16)
  61.         turtle.refuel()
  62.     end
  63.     place()
  64.     coupe()
  65.     stockBonemeal()
  66.     range()
  67.     stockCoal()
  68.     stockSapling()
  69.    
  70.  
  71.     sleep(5)
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement