Jump to content


Member Since 04 Oct 2014
Offline Last Active Mar 31 2020 03:16 PM

Topics I've Started

get rf capacity from cells in table nil

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)

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)

for i,v in ipairs(cells) do
energyC = energyC + v.getRFCapacity()