Posted 03 April 2013 - 05:30 AM
What im trying to do seems simple but I believe im getting hung up in the navigation of tables embedded in other tables.
What im trying to do is simply get more details on a tank I already know the location of. Eg. -3, 0, 3.
But not just to for loop through them. I specifically want to pull only tank capacity and tank amount. (To do a percent full tracking kind of thing.
Typing this question from cell phone so please excuse minor syntax errors.
Im trying something like:
tankRelLoc =("-3, 0, 3")
sensor = sensor.wrap ("top")
tankDetails = sensor.getTargetDetails (tankRelLoc)
– this next line is the part that I cant find the simple or functional way to do… but what I want is equivalent to this:
tankCapacity = (tankDetails.tanks.1.Capacity)
tankAmount = (tankDetails.tanks.1.Amount)
In testing tankDetails.tanks gives me the tank key of 1 and a table.. but I cant get past that.
Is there an easy refference to dig deeper into the embedded tables all at once, or do I have to open them up by pairs?
How would you get the capacity/amount of a known tank?
What im trying to do is simply get more details on a tank I already know the location of. Eg. -3, 0, 3.
But not just to for loop through them. I specifically want to pull only tank capacity and tank amount. (To do a percent full tracking kind of thing.
Typing this question from cell phone so please excuse minor syntax errors.
Im trying something like:
tankRelLoc =("-3, 0, 3")
sensor = sensor.wrap ("top")
tankDetails = sensor.getTargetDetails (tankRelLoc)
– this next line is the part that I cant find the simple or functional way to do… but what I want is equivalent to this:
tankCapacity = (tankDetails.tanks.1.Capacity)
tankAmount = (tankDetails.tanks.1.Amount)
In testing tankDetails.tanks gives me the tank key of 1 and a table.. but I cant get past that.
Is there an easy refference to dig deeper into the embedded tables all at once, or do I have to open them up by pairs?
How would you get the capacity/amount of a known tank?