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

Error "spine:51: attempt to index ? (a nil value)

Started by LeviM, 08 January 2015 - 03:12 PM
LeviM #1
Posted 08 January 2015 - 04:12 PM
SOLVED!


Hi! I have started to create an operating system and a adjoining API. In the OS it will try to install an app on the 'spine' API by executing

spine.appInst(name,code)
but it returns the error included in the title.

If you could take a quick peek at my code of both the OS and spine I would be very grateful.

OS (App installer function is on line ~160)
http://pastebin.com/u5v7THEy
Spine (App installer function is at the bottom)
http://pastebin.com/rezyBER6
Edited on 08 January 2015 - 06:40 PM
Lyqyd #2
Posted 08 January 2015 - 05:35 PM
That's not an up-to-date copy of your API (it only has 50 lines, so would not throw that error on line 51), but the issue is that APIs do not have access to the shell "API".
LeviM #3
Posted 08 January 2015 - 06:26 PM
That's not an up-to-date copy of your API (it only has 50 lines, so would not throw that error on line 51), but the issue is that APIs do not have access to the shell "API".
I removed a couple of usless lines :D/> (It would have had an error on line 48), is there anyway I could run commands without shell? Or would I have to use the http API to get the code and right it to a file?
Lyqyd #4
Posted 08 January 2015 - 07:12 PM
In this case, the easiest thing to do would be to just use the http API directly. It's only six or seven lines to grab the data from pastebin and write it to a file.
LeviM #5
Posted 08 January 2015 - 07:39 PM
In this case, the easiest thing to do would be to just use the http API directly. It's only six or seven lines to grab the data from pastebin and write it to a file.
Okay, thanks for your help :)/>