Posted 30 March 2014 - 12:18 PM
Hi!
I just got into CC and Lua coding, and I'm currently working on a fully scalable IC2 energy monitoring program. My code runs fine until line 148, where I get the "attempt to call index ?" error. I have set the table with pbat = {}, and I'm trying to add to the table with a for loop.
Current program, returns error on line 148:
http://pastebin.com/JrfmPEm2
Last program, runs fine (line 20 here is the same variable/string/code thingy I'm struggling with on the current program):
http://pastebin.com/YMKhrJ8n
I am aware this error falls under the "common errors" category, but I can't seem to understand why I didn't get the error in my last program.
I just got into CC and Lua coding, and I'm currently working on a fully scalable IC2 energy monitoring program. My code runs fine until line 148, where I get the "attempt to call index ?" error. I have set the table with pbat = {}, and I'm trying to add to the table with a for loop.
for i = 1,batboxes do
[b]pbat[i] = batbox[tostring(i)].getEUStored()[/b] --Line 148
cbat[i] = batbox[tostring(i)].getEUCapacity()
print("BatBox", i, ": ", pbat[i], " EU / ", cbat[i], " EU")
end
I wrote a simpler program with the same piece of code in it earlier, and that ran fine..Current program, returns error on line 148:
http://pastebin.com/JrfmPEm2
Last program, runs fine (line 20 here is the same variable/string/code thingy I'm struggling with on the current program):
http://pastebin.com/YMKhrJ8n
I am aware this error falls under the "common errors" category, but I can't seem to understand why I didn't get the error in my last program.