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'
Program
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)