This project has been retired (but the live version might still be running). Please fork and continue work on it if you find it useful.
A Windows Power Shell script that attempts to total up Elite Dangerous played time
- Open a Power Shell window. If you search for 'powershell' in Windows 10 start menu you should get a hit on 'Windows PowerShell'. Run that and it will open a window with a prompt.
- use the
cd
command to Change Directory to where you downloaded the ed-played-time.ps1 script - Now just type
ed-played-time.ps1
and hit return to run the script. It should find all the Journal.*.*.log files in the standard location, find all the gameplay sessions in each, and total up those play times. It will output:- A line for each Journal file found:
parse_journal Journal.YYMMDDHHMMSS.NN.log
- The total time played it found.
- A line for each Journal file found:
- It will also write a file
ed-played-time.csv
in the Journals folder. This, obviously, is a CSV format file with each line containing the 'end' timestamp and time delta for a session. This should be easy to import into any spreadsheet for further processing, such as making a graph.
If you happen to have .ps1
files associated with Windows PowerShell
on your system then you might be able to just double-click the file to get it to do its work. On my system they're associated with NotePad
(security paranoia). If I manually Open with
PowerShell then the window flashes up and closes before I can see much of anything.
If you like you can supply one, or both, of the -verbose
and -debug
command-line flags in order to get more output.
-verbose
- Show the start and end times of each session it found, the time different between them, and the new total played time up to that point.-debug
- Lots and lots of additional output that will probably mean nothing to you, and just spam your PowerShell window. It's for what it says on the tin, debugging.
If you really want to look at all the verbose and/or debug output then you probably want to page it:
./ed-played-time.ps1 -verbose -debug *>&1 | Out-Host -Paging
Here's an example of how to turn the resulting CSV file into a graph, using Google Sheets.
-
Login to Google Sheets
https://docs.google.com/spreadsheets
-
Create a new
Blank
sheet -
Import the CSV file:
File
menuImport
menu itemUpload
menu item- Drag the ed-played-time.csv file in to the dialogue.
- On the dialogue that pops up just click
Import data
, the defaults should work.
-
Create a Chart:
- Left-click the 'TimeStamp' cell, A2.
- Shift-Left-click the bottom cell in column B.
Insert
menuChart
menu item
This will create a default line chart. You might prefer a Column Chart, in which case:- Click the Chart
- Now click the "3 vertical dots" menu handle in the top right of the Chart.
- Click
Edit chart
on the popup menu. - In the
Setup
part of the right handChart editor
pane clickChart type
and selectColumn chart
.
NB: This will give you a chart with each column being a play session, and you could, of course, have multiple per day, or none for days. The data/setup would need a little massaging to be strictly per day columns, including any empty days.
I've taken some care to have this time accounting be accurate, but unfortunately some quirks of the events written to the Journal files get in the way.
-
Obviously I can't detect if someone is just sat in a station, space, or supercruise whilst actually idle.
-
There is no reliable way to detect if a player exits out to the Main Menu. What I've settled on for now is:
- detecting the
Commander
event which is the very start of actually logging in to the game proper. - If I was already in "seen start of a session" state (I use the
Location
event for this purpose, so it will trigger later than theCommander
event for the first login in a session) then use the timestamp of the immediately preceding event as when the player had exited to the Main Menu. - There might be other events that are output whilst in the Main Menu, particularly adding or removing friends and the like. In that case the accounting won't be correct.
But, if all you did was exit to the Main Menu, idle there a while, then go back in, the event immediately before the
Commander
event for this fresh login should be theMusic
event that going to the Main Menu triggered.
NB: ThatMusic
event is not aMainMenu
one, as it is when you initially run the game client. If it was then I could have just used that. In my testing it's a"MusicTrack:"Exploration"
event, and that is also written, at least, when logged in and docked at a space port.
- detecting the
-
Due to the fudge for detecting exiting to the Main Menu the code does not yet detect:
- Player logs in, plays for a while or not.
- Player exits to main menu and idles there.
- Player fully exits the game without logging in to the game proper again.
In this case the script will use the timestamp from the last line in the Journal, as the player fully exits the game client, for the end of that session, and thus erroneously account for extra play time.