Posted 09 December 2013 - 11:27 PM
Hi All
PasteBin - Code
PasteBin - TxtFile
When running the attached code I am getting "opencc:22: attempt to index ? (a nil value)" error thrown up.
So i replaced the "foo" variable with just the written out string "4,-1,-2" and it calls the table and runs the program perfectly. I cannot, for the life of me, understand the difference between the "foo" variable being written plain or being written by the "tabID" argument is?!
So just to clarify:
This works
This does not
But printing this gives exactly the same output (visibly in-game anyway)
Any help would be much appreciated! :D/>
PasteBin - Code
PasteBin - TxtFile
When running the attached code I am getting "opencc:22: attempt to index ? (a nil value)" error thrown up.
So i replaced the "foo" variable with just the written out string "4,-1,-2" and it calls the table and runs the program perfectly. I cannot, for the life of me, understand the difference between the "foo" variable being written plain or being written by the "tabID" argument is?!
So just to clarify:
This works
function getCount(tabID)
print(tabID)
foo = "4,-1,-2"
tabInv = inv.getTargets()[foo]
invCount = tabInv["ItemCount"]
return invCount
end
This does not
function getCount(tabID)
print(tabID)
foo = tostring(tabID)
tabInv = inv.getTargets()[foo]
invCount = tabInv["ItemCount"]
return invCount
end
But printing this gives exactly the same output (visibly in-game anyway)
function getCount(tabID)
foo = "4,-1,-2"
print(tostring(tabID))
print(foo)
end
Any help would be much appreciated! :D/>