Posted 24 December 2012 - 09:21 AM
When I attempt to run this code it does not respond and my turtle just sits there, does anyone see a problem which may cause that?
I believe it might be this part of the code, but I am unaware what I should do to fix it.
local function checkFuel()
if turtle.getFuelLevel() < 20 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 fell()
digmove()
column()
turtle.turnRight()
digmove()
turtle.turnLeft()
column()
end
local function replant()
turtle.select(15)
turtle.suck()
turtle.place()
turtle.turnLeft()
turtle.suck()
turtle.forward()
turtle.suck()
turtle.turnRight()
turtle.suck()
turtle.place()
turtle.turnRight()
turtle.suck()
turtle.place()
turtle.turnRight()
turtle.suck()
turtle.forward()
turtle.suck()
for slot=3,7 do
turtle.select(slot)
turtle.drop()
end
turtle.turnLeft()
turtle.turnLeft()
turtle.select(15)
turtle.place()
turtle.select(2)
while not turtle.compare() do
turtle.select(16)
turtle.place()
turtle.select(2)
end
end
while true do
fell()
replant()
end
I believe it might be this part of the code, but I am unaware what I should do to fix it.
for slot=3,7 do
turtle.select(slot)
turtle.drop()
end