Posted 01 October 2012 - 11:36 PM
i'm having a problem finding the errors :S and yes its a treefarm named wood… (edit fixed it :)/>/> and now it needs a redstone current to start :(/>/> sweet )
function hasItPower()
if redstone.getInput("back", true) then
checkSaplingSupply()
else
sleep(5)
end
end
function checkSaplingSupply()
turtle.select(2)
if turtle.getItemCount(2) > 0 then
logg()
elseif turtle.getItemCount(2) > 0 then
turtle.select(1)
sleep(2)
checkSaplingSupply()
end
end
function logg()
for i=1,6 do
work()
end
attFem()
sleep(20)
end
function work()
framFem()
turtle.turnRight()
if turtle.detect() then
turtle.select(1)
cut()
elseif not turtle.detect() then
turtle.turnLeft()
end
end
function framFem()
for i=1,5 do
turtle.forward()
end
end
function attFem()
for i=1,30 do
turtle.back()
end
end
function cut()
turtle.select(1)
turtle.dig()
turtle.forward()
turtle.digDown()
turtle.select(2)
turtle.placeDown()
while turtle.detectUp() do
goHigh()
end
goDown()
end
function goHigh()
turtle.select(1)
turtle.digUp()
turtle.up()
end
function goDown()
while not turtle.detectDown() do
turtle.down()
end
turtle.turnRight()
turtle.turnRight()
turtle.forward()
turtle.select(1)
turtle.drop()
turtle.turnRight()
end
while true do
hasItPower()
end
Edited on 02 October 2012 - 07:13 AM