I am currently testing nuclear power plant blueprints and decided to build my own. In order to test properly I need to know exactly how much electricity is produced/consumed.
Now it shows 2.7 GW. Theoretical production is 2720 MW.
Yes there is a mod where you can place pink accumulator and adjust its consumption. But it is not reliable as changing its power consumption will demand more power as it states until is stabilized.
AFAIK there is currently no solution to this simple trivial problem of just showing a full value with 3 decimals after '.' such as 2.720 would be seen, or is it?
How to increase precision of displaying electricity consumption?
How to increase precision of displaying electricity consumption?
- Attachments
-
- factorio_question_electric_network_in_MW.jpg (22.22 KiB) Viewed 2572 times
Re: How to increase precision of displaying electricity consumption?
You can run this code while hovering over a power pole.
Code: Select all
/c
precision = defines.flow_precision_index.one_second
network = game.player.selected.electric_network_statistics
for name, _ in pairs(network.input_counts) do
energy = network.get_flow_count{name = name, input = true, precision_index = precision}
game.print("Input - " .. name .. ": " .. energy * 59.8 .. " W")
end
for name, _ in pairs(network.output_counts) do
energy = network.get_flow_count{name = name, input = false, precision_index = precision}
game.print("Output - " .. name .. ": " .. energy * 59.8 .. " W")
end
Re: How to increase precision of displaying electricity consumption?
Thank you.DaveMcW wrote: ↑Wed May 13, 2020 12:15 am You can run this code while hovering over a power pole.
Code: Select all
/c precision = defines.flow_precision_index.one_second network = game.player.selected.electric_network_statistics for name, _ in pairs(network.input_counts) do energy = network.get_flow_count{name = name, input = true, precision_index = precision} game.print("Input - " .. name .. ": " .. energy * 59.8 .. " W") end for name, _ in pairs(network.output_counts) do energy = network.get_flow_count{name = name, input = false, precision_index = precision} game.print("Output - " .. name .. ": " .. energy * 59.8 .. " W") end
Re: How to increase precision of displaying electricity consumption?
it does not work now . can u fix it ? or can i put code in a mod? thanks .DaveMcW wrote: ↑Wed May 13, 2020 12:15 am You can run this code while hovering over a power pole.
Code: Select all
/c precision = defines.flow_precision_index.one_second network = game.player.selected.electric_network_statistics for name, _ in pairs(network.input_counts) do energy = network.get_flow_count{name = name, input = true, precision_index = precision} game.print("Input - " .. name .. ": " .. energy * 59.8 .. " W") end for name, _ in pairs(network.output_counts) do energy = network.get_flow_count{name = name, input = false, precision_index = precision} game.print("Output - " .. name .. ": " .. energy * 59.8 .. " W") end
Re: How to increase precision of displaying electricity consumption?
Change one_second to five_secondslyarain wrote: ↑Thu Aug 25, 2022 2:41 pmit does not work now . can u fix it ? or can i put code in a mod? thanks .DaveMcW wrote: ↑Wed May 13, 2020 12:15 am You can run this code while hovering over a power pole.
Code: Select all
/c precision = defines.flow_precision_index.one_second network = game.player.selected.electric_network_statistics for name, _ in pairs(network.input_counts) do energy = network.get_flow_count{name = name, input = true, precision_index = precision} game.print("Input - " .. name .. ": " .. energy * 59.8 .. " W") end for name, _ in pairs(network.output_counts) do energy = network.get_flow_count{name = name, input = false, precision_index = precision} game.print("Output - " .. name .. ": " .. energy * 59.8 .. " W") end
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: How to increase precision of displaying electricity consumption?
changed,but error still.Xorimuth wrote: ↑Thu Aug 25, 2022 2:48 pmChange one_second to five_secondslyarain wrote: ↑Thu Aug 25, 2022 2:41 pmit does not work now . can u fix it ? or can i put code in a mod? thanks .DaveMcW wrote: ↑Wed May 13, 2020 12:15 am You can run this code while hovering over a power pole.
Code: Select all
/c precision = defines.flow_precision_index.one_second network = game.player.selected.electric_network_statistics for name, _ in pairs(network.input_counts) do energy = network.get_flow_count{name = name, input = true, precision_index = precision} game.print("Input - " .. name .. ": " .. energy * 59.8 .. " W") end for name, _ in pairs(network.output_counts) do energy = network.get_flow_count{name = name, input = false, precision_index = precision} game.print("Output - " .. name .. ": " .. energy * 59.8 .. " W") end
Re: How to increase precision of displaying electricity consumption?
You have to hover over a power polelyarain wrote: ↑Thu Aug 25, 2022 3:02 pm332.pngXorimuth wrote: ↑Thu Aug 25, 2022 2:48 pmChange one_second to five_secondslyarain wrote: ↑Thu Aug 25, 2022 2:41 pmit does not work now . can u fix it ? or can i put code in a mod? thanks .DaveMcW wrote: ↑Wed May 13, 2020 12:15 am You can run this code while hovering over a power pole.
Code: Select all
/c precision = defines.flow_precision_index.one_second network = game.player.selected.electric_network_statistics for name, _ in pairs(network.input_counts) do energy = network.get_flow_count{name = name, input = true, precision_index = precision} game.print("Input - " .. name .. ": " .. energy * 59.8 .. " W") end for name, _ in pairs(network.output_counts) do energy = network.get_flow_count{name = name, input = false, precision_index = precision} game.print("Output - " .. name .. ": " .. energy * 59.8 .. " W") end
changed,but error still.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: How to increase precision of displaying electricity consumption?
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics