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

'attempt to call nil' when calling function from another function

Started by ltnoodles, 11 April 2015 - 12:22 PM
ltnoodles #1
Posted 11 April 2015 - 02:22 PM
I'm making a program to simply the creation of turtle programs, but whenever I try to call the 'go' command and it has to dig, it throws the error 'attempt to call nil'. I have tried moving the function above the dig function, and beneath it, you can all dig from the main code body without issue and you call call move from 'go' without issues, I really am at a loss for what the issue is
Creator #2
Posted 11 April 2015 - 06:12 PM
Show us some code!
Square789 #3
Posted 11 April 2015 - 08:15 PM
Maybe you typed the functions incorrectly
They are :
  • turtle.dig()
  • turtle.digUp()
  • turtle.digDown()
  • turtle.forward()
  • turtle.back()
  • turtle.up()
  • turtle.down()
  • turtle.turnRight()
  • turtle.turnLeft()
You can see all of them by clicking here
They are case sensitive, which means that you can't type
turtle.turnright()
or
TUrtLe.TURNrighT()
But please give us code so we can help better