Advertisement
Guest User

lumberjack

a guest
May 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.13 KB | None | 0 0
  1. function plein()
  2.    for i = 3,16 do
  3.    turtle.select(i)
  4.    turtle.refuel(1)
  5.    end
  6. end
  7.  
  8. while true do
  9.     local success, data = nil, nil
  10.     turtle.select(16)
  11.     success, data = turtle.inspect()
  12.     while data.name == "minecraft:sapling" do
  13.        success, data = turtle.inspect()
  14.    
  15.     end
  16.     turtle.dig()
  17.     if turtle.getFuelLevel() < 32 then plein() end
  18.     turtle.forward()
  19.     while data.name == "minecraft:log" do        turtle.digUp()
  20.         turtle.up()
  21.         success, data = turtle.inspectUp()
  22.     end
  23.     success, data = turtle.inspectDown()
  24.     while not success do
  25.         turtle.down()
  26.         success, data = turtle.inspectDown()
  27.     end
  28.     turtle.back()
  29.     local logs = turtle.getItemCount(16)
  30.     if logs >=6 then
  31.         local detail = turtle.getItemDetail(2)
  32.         if detail then
  33.             turtle.select(2)
  34.             turtle.drop()
  35.         end
  36.         turtle.select(4) -- Sélectionne le slot 3
  37.         turtle.craft(1) -- Craft 1 bûche (=> 4 planches)
  38.         turtle.turnRight()
  39.         turtle.turnRight()
  40.         for i = 1, 7 do
  41.             turtle.forward()
  42.         end
  43.         turtle.up()
  44.         turtle.select(16)
  45.         turtle.drop(5)
  46.         turtle.down()
  47.         turtle.turnLeft()
  48.         turtle.forward()
  49.         turtle.turnRight()
  50.         turtle.select(4)
  51.         turtle.drop()
  52.         turtle.turnRight()
  53.         turtle.forward()
  54.         turtle.turnLeft()
  55.         turtle.down()
  56.         turtle.down()
  57.         -- Récupération d'un charbon et refuel
  58.         turtle.select(13)
  59.         local suck = turtle.suck(1)
  60.         if suck then
  61.             turtle.refuel()
  62.         end
  63.         turtle.turnRight()
  64.         turtle.turnRight()
  65.         turtle.forward()
  66.         turtle.forward()
  67.  
  68.         turtle.select(2)
  69.         local saplingCount = turtle.getItemCount()
  70.         if saplingCount < 2 then
  71.             local missingSapling = 2 - saplingCount
  72.             suck = turtle.suckDown(missingSapling)
  73.         end
  74.         turtle.up()
  75.         turtle.up()
  76.         for i = 1, 5 do
  77.             turtle.forward()
  78.         end
  79.     end
  80.     turtle.select(2)
  81.     turtle.place()
  82. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement