Posted 20 July 2013 - 04:22 PM
I was making an API for pixel collision, for myself. But it didn't work because of "shell.run", I did write the script correctly. But I kept getting errors especially on the line which contained shell.run. I have checked so many times, I've even changed it a little bit. Always got an error. Then I tried using Fs API. And I typed this code:
In the program "collisions" I had a table which was called collisions, and in the main script I used that table, and I got an error, table expected got nil. Then I tried putting the table inside the script before h.close() and I wrote something like this collisions = solids. Then I used solids in the main script instead of collisions, but I still got table expected, got nil.
Maybe it's just a bug, that I'm not allowed to use shell.run in my script, all I wanted to do is make an API that reads code from a specified file. And that file must contain a table called the same as the file. I have tried using a different name of the table and the file, so they're not the same. It didn't work still. If you don't get my problem, can you atleast show me a (tested and working!) script of what I should use.
h = fs.open("collisions","r")
h.readAll()
h.close()
In the program "collisions" I had a table which was called collisions, and in the main script I used that table, and I got an error, table expected got nil. Then I tried putting the table inside the script before h.close() and I wrote something like this collisions = solids. Then I used solids in the main script instead of collisions, but I still got table expected, got nil.
Maybe it's just a bug, that I'm not allowed to use shell.run in my script, all I wanted to do is make an API that reads code from a specified file. And that file must contain a table called the same as the file. I have tried using a different name of the table and the file, so they're not the same. It didn't work still. If you don't get my problem, can you atleast show me a (tested and working!) script of what I should use.