--spinds and check for ajcencent tree
--if it finds one it move up while
--chopping. It expects uppon moving
--down it goes to the bottom, 1 up
--and sucks, to enable collection of
--saplings via water transport.
--replants after gathering

local noop = function() end
print("One-way lumberjack mode active")
rednet.open("right")

local function fell()
 while turtle.dig() do 
  turtle.digUp()
  turtle.up()
 end
 while turtle.down() do
   noop()
 end  
 turtle.up()
end

while true do
 turtle.select(1)
 lumberAmnt=turtle.getItemCount(1)
 if lumberAmnt > 50 then
  turtle.down()
  turtle.dropDown(lumberAmnt-1 )
 end
 if turtle.compare() then
  fell()
  turtle.select(2)
  turtle.place()
rednet.broadcast(os.clock()..":"..math.floor(turtle.getFuelLevel()/10)..";"..turtle.getItemCount(1))
  turtle.select(16)
  if turtle.getItemCount(16) >1 then
   turtle.place()
  end
 end
 sleep(1)
 turtle.suckUp()
 turtle.suckDown()
end
