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

[Lua][Error] Attempt to Call Nil from attempted mining API

Started by ENH, 07 May 2013 - 04:51 PM
ENH #1
Posted 07 May 2013 - 06:51 PM
Title: [Lua][Error] Attempt to Call Nil from attempted mining API

I'm trying to get a simple mining API going to get my feet wet, but I seem to be handling something wrong is how I'm structuring the API. What it's supposed to do right now is just make a 3 deep, 4 long trench to test the API.

API 'tunnel'

function dig(Count)
repeat
while turtle.foreward() == false do
turtle.dig()
end
Count = Count - 1
until count <= 0
end

function mine(Count)
repeat
while turtle.foreward() == false do
turtle.dig()
end
turtle.digUp()
turtle.digDown()
Count = Count - 1
until count <= 0
end

Program

os.loadAPI("tunnel")
turtle.digDown()
turtle.down()
turtle.digDown()
turtle.down()
turtle.digDown()
turtle.down()
turtle.digDown()
tunnel.mine(3)
Cranium #2
Posted 07 May 2013 - 06:57 PM
Split to new topic.

turtle.foreward() should be turtle.forward()
You just spelled it wrong, that's all.
Sammich Lord #3
Posted 07 May 2013 - 06:58 PM
It is turtle.forward not turtle.foreward.

You and your ninja brain.
ENH #4
Posted 07 May 2013 - 07:02 PM
Damnit. I should have believed my teachers in elementary school. Spelling does matter.