FiddleComputers

Felling turtle

Mar 30th, 2019
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function refuel()
  2.     if turtle.getFuelLevel() < 150 then
  3.         turtle.select(1)
  4.         while turtle.getFuelLevel() < 150 do
  5.             turtle.refuel(1)
  6.         end
  7.     end
  8. end
  9.  
  10. while true do
  11.     refuel()
  12.     if turtle.select(13) and turtle.compareDown() then -- SLOT 13: FORWARD
  13.         turtle.forward()
  14.         refuel()
  15.     elseif turtle.select(14) and turtle.compareDown() then -- SLOT 14: TREE
  16.         if turtle.turnRight() and turtle.select(2) and turtle.compare() then
  17.             while turtle.compare() do
  18.                 turtle.dig()
  19.                 turtle.digUp()
  20.                 turtle.up()
  21.             end
  22.             turtle.select(14)
  23.             while not turtle.compareDown() do
  24.                 turtle.down()
  25.             end
  26.             refuel()
  27.             turtle.select(4)
  28.             turtle.place()
  29.         else
  30.             turtle.turnLeft()
  31.         end
  32.     elseif turtle.select(15) and turtle.compareDown() then -- SLOT 15: TURN RIGHT
  33.         turtle.turnRight()
  34.         turtle.forward()
  35.         turtle.turnForward()
  36.         refuel()
  37.     elseif turtle.select(16) and turtle.compareDown() then -- SLOT 16: RECHARGE (See bottom for pattern)
  38.         if turtle.turnLeft() and turtle.select(4) and turtle.getItemCount() < 32 then
  39.             while turtle.getItemCount() < 64 do
  40.                 turtle.suck(1)
  41.             end
  42.         end
  43.         turtle.turnRight()
  44.         turtle.forward()
  45.         turtle.turnForward()
  46.         turtle.turnLeft()
  47.         if turtle.select(1) and turtle.getItemCount() < 64 then
  48.             while turtle.getItemCount() < 64 and turtle.suck(1) do
  49.                 print("Récupération charbon...")
  50.             end
  51.         end
  52.         turtle.turnRight()
  53.         turtle.forward()
  54.         if turtle.select(2) and turtle.getItemCount() > 1 then
  55.             turtle.turnLeft()
  56.             turtle.drop(64)
  57.             turtle.select(3)
  58.             turtle.drop(64)
  59.             turtle.select(2)
  60.             turtle.suck(1)
  61.             turtle.turnRight()
  62.         end
  63.         turtle.turnForward()
  64.         refuel()
  65.     end
  66. end
  67.  
  68. --  COAL        ^
  69. --              |
  70. --  LOGS        |
  71. -- 
  72. --  SAPLINGS    T
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×