Posted 14 April 2013 - 12:51 AM
Hi I want help please with my tree farm.I want my turtle to suck the saplings,coal and bonemeal out of an chest.Here is my program
Thanx alot
P.S sorry for posting this 2 times on the site becuase I didnt know in the begin where to post this so Thanx
local function checkFuel()
if turtle.getFuelLevel() < 1 then
turtle.select(1)
turtle.refuel(1)
end
end
local function column()
while turtle.digUp() do
turtle.dig()
checkFuel()
turtle.up()
end
turtle.dig()
checkFuel()
while turtle.down() do
checkFuel()
end
end
local function digmove()
checkFuel()
turtle.dig()
turtle.forward()
end
local function plant()
turtle.select(2)
turtle.forward(1)
turtle.place()
turtle.turnRight()
turtle.forward(1)
turtle.turnLeft()
turtle.place()
turtle.turnRight()
turtle.turnRight()
turtle.forward(1)
turtle.turnRight()
turtle.turnRight()
turtle.place()
turtle.turnLeft()
turtle.forward(1)
turtle.turnRight()
turtle.place()
end
local function dropwood()
for i=3, 16 do
turtle.select( i)
turtle.dropDown()
end
turtle.select(3)
end
while true do --Always loop
dropwood()
plant()
turtle.up()
local Wait, Correct = "0", "1"
while Wait~=Correct do
if turtle.detect()==true then
Wait = "1"
print("success")
end
sleep(5)
end
turtle.down()
digmove()
column()
turtle.turnRight()
digmove()
turtle.turnLeft()
column()
turtle.turnLeft()
digmove()
digmove()
turtle.turnRight()
column()
turtle.turnRight()
turtle.forward(1)
turtle.turnRight()
turtle.forward(1)
turtle.turnRight()
turtle.turnRight()
end
Thanx alot
P.S sorry for posting this 2 times on the site becuase I didnt know in the begin where to post this so Thanx