This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
dcleondc's profile picture

what is wrong with my code?

Started by dcleondc, 01 August 2012 - 03:30 AM
dcleondc #1
Posted 01 August 2012 - 05:30 AM
here is my code

--[[
Made by Dcleondc
8x8 farm
--]]
function turnRight()
    turtle.turnRight()
    turtle.moveForward()
    turtle.turnRight()
end
function turnLeft()
    turtle.turnLeft()
    turtle.moveForward()
    turtle.turnLeft()
end

function farm()
    turtle.digDown()
    turtle.select(1)
    turtle.placeDown()
    turtle.moveForward()
end
function done()
    turtle.select(16)
    while turtle.compareDown() do
    if turtle.compareDown() then
		    farm()
    else
		    turtle.moveForward()
    end
    end
end
for i=1,2 do
    for o=1,8 do
	    done()
    end
    turnRight()
    for p=1,8 do
	    done()
    end
    turnLeft()
end
all it does is turn right then give this error

test:9: attempt to call nil
Lyqyd #2
Posted 01 August 2012 - 05:31 AM
There is no turtle.moveForward() function. You're thinking of turtle.forward().