Posted 27 July 2012 - 08:45 PM
I am working on an API for operating large numbers of turtles, but am getting very hung up on this particular error. I am not new to programming, but I am only a couple days into using Lua. I am having issues with passing variable arguments to shell.run().
The relevant code is posted here: https://gist.github....471fcc771d3b375
I place this in the correct API folder to make it accessible to my machines, then enter the game and attempt the following.
The relevant code is posted here: https://gist.github....471fcc771d3b375
I place this in the correct API folder to make it accessible to my machines, then enter the game and attempt the following.
- Boot turtle, start swarm.worker()
- Boot computer, start swarm.queen("tunnel", "4")
swarm:121: attempt to index ? (a nil value)
I am not sure what is going wrong. The interactive lua prompt has no problems with either shell.run(unpack{"tunnel", "4"})
or shell.run("tunnel", unpack({4}))
I'm sure the trouble is with my own unfamiliarity with Lua, I would greatly appreciate help and education.