This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Heavens's profile picture

No Data In Table Using Openperipherals On Railcraft Tank

Started by Heavens, 04 August 2013 - 02:29 PM
Heavens #1
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.


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
Lyqyd #2
Posted 04 August 2013 - 04:32 PM
Split into new topic.

You might try asking over on the OpenPeripheral topic in the Peripherals section.
Heavens #3
Posted 04 August 2013 - 10:49 PM
Thanks! I've already made one. I'll update this topic if I know something new :)/>