Panakotta00 / FicsIt-Networks

Control, Monitor, Manage and Automate your Satisfactory.
https://ficsit.app/mod/FicsItNetworks
GNU General Public License v3.0
170 stars 53 forks source link

Nuclear Power Plant always reports zero fuel rods #344

Closed kfpopeye closed 3 weeks ago

kfpopeye commented 3 weeks ago

I use the following code (truncated) to monitor nuclear power plants. The item count for the rods is always zero even when I have confirmed there are more. I tried to for loop through the fctry:getInventories() and there were only 3 items in the array.

local factories = component.proxy(component.findComponent(siteNick)) if not factories then error("Factories was nil") end

for _, fctry in pairs(factories) do local data_output = " OUT> " local data_input = " IN> " local invs

if (fctry:getType().Name == "Build_GeneratorNuclear_C") then

local n = fctry:getInventories()[1] -- 1 output inventory (waste) data_output = data_output .. "Nuclear Waste: " .. n.itemCount .. " " n = fctry:getInventories()[2] -- 2 fuel inventory (water) data_input = data_input .. "Water: " .. makePercentage(n.itemCount/50000) .. "% " n = fctry:getInventories()[3] -- 3 inventory potential (rods) NOPE!!!!!! Bug in mod???!??!?!?! data_input = data_input .. "Rods :" .. n.itemCount

net:broadcast(port, "reactor", name, data_output, data_input, prod) end --if nuclear plant end --for

Panakotta00 commented 3 weeks ago

I'm sorry but i tried and the reactor is reporting its data as intended. However the inventory of fuel rods was inventory 2 in my case. I can not reproduce the issue.