I want to try and compare the two variables capacity and amount but I have no clue as to how to access the data. I will include screenshots from in-game. Here is the code:
t=peripheral.wrap("left")
local infoTable = t.getTankInfo("west")
print(infoTable.capacity)
The function returns the following.
{
{
capacity = 16000,
contents = {
id = 0;
amount = 0,
},
},
}
EDIT: I got it. Its a table of tables. so to access it.
infoTable[1].capacity
and for the cotents table
infoTable[1].contents.amount
http://puu.sh/gtzX9/acc0839b11.jpg
http://puu.sh/gtzZW/6b2aa52f12.jpg