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

OpenPeripherals - Railcraft Tanks API

Started by OczkoSX, 01 May 2014 - 08:25 AM
OczkoSX #1
Posted 01 May 2014 - 10:25 AM
Hi! How can i check all methods for rc's tanks ? I did p = peipheral.wrap("bottom"), p.listMethods(), but it just print listMethods(), getAdvancedMethodsData() and TankInfo(direction). When i use these methods it prints: table: <some signs here>

Can you help me?
OczkoSX #2
Posted 01 May 2014 - 10:33 AM
Ah my bad. I just had to do something like this:

local valve = peripheral.wrap("right")
local tableInfo = valve.getTanks("unknown")
for k, v in pairs(tableInfo) do
  for x, y in pairs(v) do
			    print(x .. ": " .. y)
  end

(code copied from other thread). I'm new on tables ;)/>
Bomb Bloke #3
Posted 01 May 2014 - 11:31 AM
The notes re getting documentation out of OpenPeripheral are here; they might be useful to you in future.