Posted 27 February 2014 - 08:06 AM
Hello there,
I hope anyone can help me.
I tried to write a small farming program for a turtle and wanted to put some functions, that I maybe could use in the future or for other programs as well, in an api.
Unfortunately, everytime I try to load the api via os.loadapi(), I get the error "attempt to call nil"
I tried to load the api in my script and as well on the lua prompt directly. Both give the same result.
I have three scripts:
After that I start the program ("farming"). And get the error "farming:17: attempt to call nil".
If I try to load the api directly on the lua prompt, I get "lua:52: attempt to call nil".
Anyone an idea what I do wrong?
I read some posts here on the forum already and tried some solutions (on other problems) already.
For example, use a absolute path, like "/farmingApi", I tried another name for the api or to put in a sub-folder instead of root.
But it didn't help.
I even tried it with a simple testApi, like
Even that gets the same error when I try to load it.
I use ComputerCraft 1.53 (FTB Unleashed).
Thanks in advance
Ascobol
I hope anyone can help me.
I tried to write a small farming program for a turtle and wanted to put some functions, that I maybe could use in the future or for other programs as well, in an api.
Unfortunately, everytime I try to load the api via os.loadapi(), I get the error "attempt to call nil"
I tried to load the api in my script and as well on the lua prompt directly. Both give the same result.
I have three scripts:
- a downloader –> http://pastebin.com/VxA8YVyc It just downloads first the api and then the program itself
- the api –> http://pastebin.com/WSeMJrTY
- the program –> http://pastebin.com/vnn9f5aj
After that I start the program ("farming"). And get the error "farming:17: attempt to call nil".
If I try to load the api directly on the lua prompt, I get "lua:52: attempt to call nil".
Anyone an idea what I do wrong?
I read some posts here on the forum already and tried some solutions (on other problems) already.
For example, use a absolute path, like "/farmingApi", I tried another name for the api or to put in a sub-folder instead of root.
But it didn't help.
I even tried it with a simple testApi, like
function sayHello()
print("Hello there!")
end
Even that gets the same error when I try to load it.
I use ComputerCraft 1.53 (FTB Unleashed).
Thanks in advance
Ascobol