So im working on a large display for my factory that tells me lots of useful things with ccSensors. One of the things I would like it to tell me is when its time to replace uranium cells (I don't want this automated). since uranium cells have a damage value for how full they are I thought I would reference that (1-10000 going strong, 10000-15000 replace cells soon, 15000-20000 cells almost dead, 0/missing cell dead).
The problem with this is I have no idea how to get the damage information out of the reactor contents to print or manipulate, any tips?
[Question] Damage Values?
Started by Zamithal, Dec 19 2012 01:25 PM
4 replies to this topic
#1
Posted 19 December 2012 - 01:25 PM
#2
Posted 19 December 2012 - 04:29 PM
Use textutils.serialize() or textutils.tabulate() to print out tables. That should allow you to figure out the parts you want and how best to grab them.
#3
Posted 19 December 2012 - 04:32 PM
or you can use a for loop
Example:
Example:
for i = 1, #nameOfTheTable do print(nameOfTheTable[i]) end
#4
Posted 19 December 2012 - 05:52 PM
anonimo182, on 19 December 2012 - 04:32 PM, said:
or you can use a for loop
Example:
Example:
for i = 1, #nameOfTheTable do print(nameOfTheTable[i]) end
#5
Posted 19 December 2012 - 06:15 PM
There are a couple topics floating around with a string.match pattern to use to get this exact information out. Basically, since the structure of the information is consistent, the string can be matched against a pattern to pull certain pieces of data out. You can then tonumber() the extracted damage value and perform whatever operations are needed. Search for "ccsensors string.match" and it should be in some of the more recent results. In fact, I believe you can search through Espen's posts specifically to find the reply I'm thinking of.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











