export energy stats to file

Place to get help with not working mods / modding interface.
Post Reply
blendi_93
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri May 27, 2016 5:06 am
Contact:

export energy stats to file

Post by blendi_93 »

hello,

i try to export energy stats to file (so i can use them for my led strip), i want something like a satisfaction bar in reallive ;).

unfortunately my solution causes fpsdrops (1 each 60 tick).

do u know a "better" method to read values like produced energy and "used" energy?

i have only 2.3k Accumlators, 1.8k solar panels and 53 steamengines, without my mod its fine.

attached my "mod".
Attachments
energy_stats_0.0.3.zip
(1.46 KiB) Downloaded 96 times

User avatar
olafthecat
Filter Inserter
Filter Inserter
Posts: 476
Joined: Fri Jul 07, 2017 4:37 pm

Re: export energy stats to file

Post by olafthecat »

You know.
Here's a reply.
Might get someone else to fix your problem.
Issue is, I have no idea what you are are talking about.
Good luck!
Gonna start playing again with 0.16 build.
That's all.

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: export energy stats to file

Post by Adil »

Well, for me it doesn't really work because, firstly, you try to iterate over dictionary (non-number keys) with `ipairs`, secondly, because solar panel has `energy` equal to zero always. I've fixed first issue below, for the second one I don't know workaround.
Code
Maybe you should make a request, so that devs would export the energy_production_statistics per force, like they do for item_production_statistics.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

blendi_93
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri May 27, 2016 5:06 am
Contact:

Re: export energy stats to file

Post by blendi_93 »

thx for ur reply.

adding new generators didnt work, cause "global.energy_sources[entity.type]" has the keys 1 2 3 4 changed to global.energy[entity.type]

HUGE thx, using entity.unit_number resolved the performance problem, next: stupid solar panels ;)

attached my current version, if interrested.
Attachments
energy-stats_0.0.4.zip
(3.07 KiB) Downloaded 93 times

Edris89
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Mar 25, 2018 5:11 am
Contact:

Re: export energy stats to file

Post by Edris89 »

really looking forward to this one. cause i too wanted to react a ledstrip with factorio.
If you someone could help would be awesome

Post Reply

Return to “Modding help”