How to increase precision of displaying electricity consumption?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
User avatar
Qeeet
Inserter
Inserter
Posts: 24
Joined: Mon Jun 10, 2019 11:24 pm
Contact:

How to increase precision of displaying electricity consumption?

Post by Qeeet »

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?
Attachments
factorio_question_electric_network_in_MW.jpg
factorio_question_electric_network_in_MW.jpg (22.22 KiB) Viewed 2572 times
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3716
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: How to increase precision of displaying electricity consumption?

Post by DaveMcW »

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
User avatar
Qeeet
Inserter
Inserter
Posts: 24
Joined: Mon Jun 10, 2019 11:24 pm
Contact:

Re: How to increase precision of displaying electricity consumption?

Post by Qeeet »

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
Thank you.
lyarain
Burner Inserter
Burner Inserter
Posts: 18
Joined: Fri Jul 15, 2022 12:16 am
Contact:

Re: How to increase precision of displaying electricity consumption?

Post by lyarain »

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
it does not work now . can u fix it ? or can i put code in a mod? thanks .
Xorimuth
Filter Inserter
Filter Inserter
Posts: 695
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: How to increase precision of displaying electricity consumption?

Post by Xorimuth »

lyarain wrote: Thu Aug 25, 2022 2:41 pm
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
it does not work now . can u fix it ? or can i put code in a mod? thanks .
Change one_second to five_seconds
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
lyarain
Burner Inserter
Burner Inserter
Posts: 18
Joined: Fri Jul 15, 2022 12:16 am
Contact:

Re: How to increase precision of displaying electricity consumption?

Post by lyarain »

Xorimuth wrote: Thu Aug 25, 2022 2:48 pm
lyarain wrote: Thu Aug 25, 2022 2:41 pm
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
it does not work now . can u fix it ? or can i put code in a mod? thanks .
Change one_second to five_seconds
332.png
332.png (66.3 KiB) Viewed 1978 times
changed,but error still.
Xorimuth
Filter Inserter
Filter Inserter
Posts: 695
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: How to increase precision of displaying electricity consumption?

Post by Xorimuth »

lyarain wrote: Thu Aug 25, 2022 3:02 pm
Xorimuth wrote: Thu Aug 25, 2022 2:48 pm
lyarain wrote: Thu Aug 25, 2022 2:41 pm
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
it does not work now . can u fix it ? or can i put code in a mod? thanks .
Change one_second to five_seconds
332.png
changed,but error still.
You have to hover over a power pole
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
lyarain
Burner Inserter
Burner Inserter
Posts: 18
Joined: Fri Jul 15, 2022 12:16 am
Contact:

Re: How to increase precision of displaying electricity consumption?

Post by lyarain »

Xorimuth wrote: Thu Aug 25, 2022 3:54 pm
You have to hover over a power pole
tnanks i just clicked to open it. it works now.
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: How to increase precision of displaying electricity consumption?

Post by FuryoftheStars »

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
Post Reply

Return to “Gameplay Help”