i thought it might work but it errors. but i know if i print them it shows the right cells and i have no clue whats wrong but its first time using the getNames like this.
temp:11: attempt to call field 'getRFCapacity'(a nil value)
local energyC = 0 local cells = {} for i, name in pairs(peripheral.getNames()) do if peripheral.getType(name) == "thermalexpansion:storage_cell" then table.insert(cells, name) end end for i,v in ipairs(cells) do energyC = energyC + v.getRFCapacity() end
Edited by VSXGsonic, 28 March 2020 - 04:21 AM.