Posted 02 January 2013 - 04:42 AM
Im trying to make a turtle that digs a tunnel system and im trying to use function i have never used that before so its pretty difficult
but every time i run my program it says
21:attempt to call nil
any help would be appreciated =)
but every time i run my program it says
21:attempt to call nil
local fuel = 1
local x = 0
term.clear()
term.setCursorPos(1,1)
function getFuel()
if turtle.getFuelLevel() <=10 then
turtle.select(1)
turtle.refuel(2)
end
function Detect()
while turtle.detect() do
turtle.dig()
end
end
end
while x < 16 do --digging the tunnel
Detect()
turtle.forward()
turtle.digDown()
turtle.turnRight()
Detect()
turtle.forward()
turtle.turnLeft()
turtle.digDown()
Detect()
turlle.forward()
turtle.digDown()
turtle.turnLeft()
Detect()
turtle.forward()
turtle.turnRight()
turtle.digDown()
x = x + 1
end
any help would be appreciated =)