Posted 30 January 2016 - 03:32 PM
Hello, I am trying to read the stored energy in a thermal expansion energy cell using openccsensors but for some reason I cant hook the stored energy. More specifically when I run the sensorview program everything seems fine: http://i.imgur.com/shSBlLa.png
However, when I run my program to read those values it seems as if the sensor is not even reading some of the elements. My code:
What am I doing wrong here? How do I hook those values?
My setup: http://i.imgur.com/3uGcFuc.png. I am using Computercraft 1.75, openCCsensors 1.7.5 and thermal expansion 4.
However, when I run my program to read those values it seems as if the sensor is not even reading some of the elements. My code:
os.loadAPI("ocs/apis/sensor")
device = sensor.wrap("left")
while true do
local elements = device.getTargets()
for k,v in pairs(elements) do
if v.Name == "Resonant Energy Cell" then
print("a " .. v.StoredPercentage)
end
end
os.sleep(0.5)
end
When I run the program, it says that v.StoredPercentage is nil (http://i.imgur.com/ko7RAmt.png). If I replace line 7(print) with:for i,n in pairs(v) do print(i) end
It is supposed to print everything it has about the Energy cell(?). Instead I only get some of its properties http://i.imgur.com/UYdJCwS.pngWhat am I doing wrong here? How do I hook those values?
My setup: http://i.imgur.com/3uGcFuc.png. I am using Computercraft 1.75, openCCsensors 1.7.5 and thermal expansion 4.