Posted 28 March 2020 - 04:15 AM
I'm trying to wrap TE energy cells using wired modems without typing all 50 or so cells
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)
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 on 28 March 2020 - 03:21 AM