I'm fairly new to LUA / turtles, but from reading the tutorials at
http://computercraft.info/wiki/Tables it looks like you can just treat them like structures / objects / classes (whichever term you're familiar with) when the keys are strings, as in the following:
Quote
A third method is to simply add the key onto the end of the table name, separated by a ".". Like the previous method, this method requires the table to already exist. It can also be treated as a regular variable, as above. This method is commonly used for when the key is a string.
local Table = {}
Table.key = true
if Table.key then print("True!") end
So shouldn't the following directly grab the values you're interested in?
print("Amount: "..tableInfo[0].amount)
print("Capacity: "..tableInfo[0].capacity)
This assumes that the list of tanks returned by getTanks is indexed numerically starting at zero, of course. If that's not the case, replace [0] with [1] or .firstTank'sKey as needed. (As I said, new to LUA.)
I'd be interested in knowing if this does work, as I got here looking for a better way to figure out how full a Railcraft tank is, and I'm considering installing Open Peripherals. My single gold AND gate RS NOR latch apparently won't work because it seems like iron tanks don't properly report when they are full - the "tank full" trigger is never true and the "space for liquid" trigger is always true, even when the tank is not being drained and the GUI shows max capacity. ("Tank empty" and "Liquid in tank" appear to work just fine, but I needed "Liquid in tank" and "Space for liquid" to make the RS latch work properly.)