Python Script for tracking BGS Influences

My squadron likes to track our actions that influence our PMF, and not wanting to have to track all of this by hand, I wrote a little script to extract this data from my journal. It's nothing fancy, having basically thrown it together for myself to get the job done with minimal fuss. Some members of my squadron have asked me to share it, so here it is. Feel free to modify to your own needs. I'll be adding more to it in the future as time allows. Right now it just tracks mission influence and trading profits. Later I plan to add the other influencers - cashed bounties, cartographic data sales, etc. Please understand, however, that I'm not taking requests at this time. If it is useful to you, great! If not, you've got the code now, so feel free to customize it as you desire.

You'll need to install Python (a popular open-source programming language) on your computer to run this. You'll also need to rename the extension from .txt to .py. IMPORTANT - Make sure to change the factionOfInterest variable to your own faction! Then you should be able to double-click on the file to run it. It will pop up a simple text console, print the data in a very simple format, and then exit when prompted. I didn't see any need to build a GUI for such a simple little tool. Enjoy!

Oh, if you find any bugs, please let me know. I've only had my own journal to test this on, so I would be surprised of there were not any bugs.
 

Attachments

  • influencers.txt
    4.2 KB · Views: 329
Last edited:
Quick note - I only have logs going back to last September, so this script runs very quickly for me. If you have years worth of logs, it may take longer. You'll only see output when a there is influence contributed to your faction on a specific date, so there may be pauses in the output for large swaths of time when you are not active with that particular faction.

With this in mind, I'll probably update the script to just focus on the last 30 days or so of activity.
 
At least one person reports that the script isn't working for them. The best way to troubleshoot is to open a command prompt / Powershell, "cd" to the directory you stored my file, and manually run it by typing:
Code:
python influencers.py
Report back here with the error message you get and that can help me debug this script for you. Of course this is only for those truly interested in what this script offers, as I suspect most players don't track BGS effects to this level of granularity (and if you do, you probably have your own system already).

ps - I'm using Python version 3.n, not the more popular older version 2. You'll need this for the unicode support.
 
My squadron likes to track our actions that influence our PMF, and not wanting to have to track all of this by hand, I wrote a little script to extract this data from my journal. It's nothing fancy, having basically thrown it together for myself to get the job done with minimal fuss. Some members of my squadron have asked me to share it, so here it is. Feel free to modify to your own needs. I'll be adding more to it in the future as time allows. Right now it just tracks mission influence and trading profits. Later I plan to add the other influencers - cashed bounties, cartographic data sales, etc. Please understand, however, that I'm not taking requests at this time. If it is useful to you, great! If not, you've got the code now, so feel free to customize it as you desire.

You'll need to install Python (a popular open-source programming language) on your computer to run this. You'll also need to rename the extension from .txt to .py. IMPORTANT - Make sure to change the factionOfInterest variable to your own faction! Then you should be able to double-click on the file to run it. It will pop up a simple text console, print the data in a very simple format, and then exit when prompted. I didn't see any need to build a GUI for such a simple little tool. Enjoy!

Oh, if you find any bugs, please let me know. I've only had my own journal to test this on, so I would be surprised of there were not any bugs.
And it is impossible to do with the web interface I can provide a server for tests, I can help with html, css Python I do not know.
 
I've been doing similar using EDDI events to write out just the mission activities. However that does not have Inf for the originating faction in its output on Mission Completed and having looked at the Journal it is missing the value I expected too. For example, Election Courier mission shows Inf ++ in the Mission Accepted log event but the corresponding Mission Completed event has no value for Inf for my faction.

If I just add up the Inf in the Completed events I would have earned nothing for this when I believe I have actually earned ++ for my faction.

Have you found this as well or am I misunderstanding what I earn for these kinds of missions?
 
Do Poll missions such as Courier for Sensitive Poll Data, Poll Data Retrieval just contribute a fixed 1 or 2 'points'' towards a daily total to win an election day then?
 
Yes thanks @goemon. I've been back through non-election time missions and they seem complete. I will test EDDI further and raise a ticket if needed, as that still seems to miss source faction influence.
 
When I double click the .py file, I see the console window pop up and close almost immediately. It's not staying open for me to read anything.

1615565776083.png
 
I thought I did have it installed. In the screenshot you can see the python command window overlayed on top of the regular windows command window.
 
Well I got the python command to actually work now. I had to use "setx PATH PythonPath" where PythonPath is the path to my python folder. (say that 7 times fast)
However I still cannot get the script to run:

1615568567791.png


edit I came up with a hack solution. I deleted this part of the script:
1615568820993.png


results look like this:
1615568850563.png

I think the issue has something to do with the stuff inside the square brackets being a string instead of a number.
 
Last edited:
<snip>

I think the issue has something to do with the stuff inside the square brackets being a string instead of a number.
Nah... entry.get("StationFaction",{}) defaults to returning an dictionary, and dictionaries have their values accessed via string keys.

So, in this case the StationFaction key for entry is returning a string, where a dictionary is expected to be returned. So probably the StationFaction field on Entry is corrupt/invalid? StationFaction is meant to be a dictionary with two values: Name and FactionState (ref: https://elite-journal.readthedocs.io/en/latest/Travel/); it shouldn't be a string.

Though the way that's written, it's going to fail anyway... if an empty dictionary is returned, and you try to access the "Name" key, you'll get a KeyError for trying to access an unknown key.
 
Last edited:
Back
Top Bottom