Posted 04 August 2013 - 04:29 PM
Hello everyone :)/>
I'm having a little trouble getting tank data from a Railcraft Iron Tank filled with water.
The following code only gives me 1, 0 if I write the table to a monitor.
Am I doing something wrong? I've done some coding but I never really wrapped my head around the whole table thing but my code should print out all the data in the tanks table right?
Any help is appreciated :D/>
The documentation for an IronTankValve peripheral:
I'm having a little trouble getting tank data from a Railcraft Iron Tank filled with water.
The following code only gives me 1, 0 if I write the table to a monitor.
local ironTankValve = peripheral.wrap("back")
local monitor = peripheral.wrap("top")
local tableInfo = ironTankValve.getTanks("back")
for k, v in pairs(tableInfo) do
monitor.write(k, v)
end
Am I doing something wrong? I've done some coding but I never really wrapped my head around the whole table thing but my code should print out all the data in the tanks table right?
Any help is appreciated :D/>
The documentation for an IronTankValve peripheral:
Spoiler
local ironTankValve = peripheral.wrap("left")
getTanks() Get information about an internal tank inside the block
local tableInfo = ironTankValve.getTanks(side)
for key, value in pairs(tableInfo) do
print(key .. " = " .. tostring(value))
end