Energy Control

Energy Control

597k Downloads

getCardData() only returns first slot.

Geird opened this issue ยท 2 comments

commented

Version: EnergyControl-1.12.2-0.1.8

What happened: After trying to multiple times, I can't seem to find a way to read any data beyond the first slot of an information panel. Based on the documentation I expected getCardData() to return "Reactor Status","100","10 000","8 500","0","5:30:18" but it just seems to return "Reactor Status".

Setup / example below.

1 (1)
The program.
1 (2)
Result.
1 (3)
Result with title removed.
1 (5)
Result with title and temperature removed.
1 (6)

Full mod list, if that's useful.

modlist.txt

commented

Function getCardData() is correct but it returns java array instead of string. Seems that CC:Tweaked cannot handle arrays.
It works it in lua console but not in lua program.

Console

lua
lua> x=peripheral.wrap('right')
lua> x.getCardData()
"0"
"Off"
"10 000"
"8 500"
"0"
"0:00:00"
lua>

Program
local x=peripheral.wrap('right')
print(x.getCardData())
Result
0 Off 10 000 8 500 0 0:00:00

Program2
local x=peripheral.wrap('right')
print(type(x.getCardData()))
Result
string <- here it should be not string

I can add a parameter and return result in different formats (array, json, plain text, etc.)

commented

Fixed in EnergyControl-1.12.2-0.1.9.jar