![Energy Control](https://media.forgecdn.net/avatars/thumbnails/268/914/256/256/637240195612582125.png)
getCardData() only returns first slot.
Geird opened this issue ยท 2 comments
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.
The program.
Result.
Result with title removed.
Result with title and temperature removed.
Full mod list, if that's useful.
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.)