Code: Select all
for x,equipment in ipairs(grid.equipment) do -- Loop through all equipment.
if (equipment.max_energy ~= 0) then
energy = energy + equipment.energy -- If it has energy, add values to total value.
energyCap = energyCap + equipment.max_energy
--if equipment.type == "battery-equipment" then
-- hasBattery = true
--else
--end
else
end
local prototype = equipment.prototype
globalPrint(prototype.energy_source.type)
--if (prototype.energy_source.type == "rana-conduit") then
transferRate = transferRate + (prototype.energy_source.energy_production)
--end
end