Posted 22 January 2014 - 02:29 PM
Hello there,
I'm currently trying to make a program to read how much Liquid XP I have in a tank. To start off with I did some research and found out that I need to use getTankInfo to pull the information and it will be brought down in a table. I've never really used tables before so went looking for some templates to get me started. all the ones I have found seem to be throwing up an error saying "bad argument: table expected, got string"
The code I'm trying to use now:
It was found somwhere in the OpenBlocks thread and seemed to be working for the person who posted it. I cannot work out why this isnt returning a table when tableinfo is one.
Thanks for reading…
Vennom
I'm currently trying to make a program to read how much Liquid XP I have in a tank. To start off with I did some research and found out that I need to use getTankInfo to pull the information and it will be brought down in a table. I've never really used tables before so went looking for some templates to get me started. all the ones I have found seem to be throwing up an error saying "bad argument: table expected, got string"
The code I'm trying to use now:
local tank = peripheral.wrap("back")
local tableInfo = tank.getTankInfo("south")
for k, v in pairs(tableInfo) do
for x, y in pairs(v) do
print(x .. ": " .. y)
end
end
It was found somwhere in the OpenBlocks thread and seemed to be working for the person who posted it. I cannot work out why this isnt returning a table when tableinfo is one.
Thanks for reading…
Vennom