Title

Message

Confirm

Want to earn a free VoiceBot Pro license? We're looking for VoiceBot translators!
<< DiscussionsReply

Trying to write elite danerous journal reader

Avatar from Gravatar.com
DAB42
30 discussion posts
I am trying to write a elite dangerous journal reader (a json file) to pickup particular events and I am getting closer but could use some help.

I need to find the last modified file beginning with the name "Journal" currently I am finding only the last file modified " status.json" the file I want looks like " Journal.180208153951.01.log"

the data looks just like this
{ "timestamp":"2018-07-10T01:58:11Z", "event":"Status", "Flags":0 }

with the following code I am able to read the last line of the file and branch on finding the string "event":"Status",

Code

Jul 10, 2018 (modified Jul 10, 2018)  • #1
Avatar from Gravatar.com
DAB42
30 discussion posts
Sorry all the solution was so simple I missed it

from f in directory.GetFiles("Journal.*.log")

still working on the event handle so the macro only runs when a change is made to the file
Jul 10, 2018  • #2
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
You could try running it on a timer and use the BFS.ScriptSettings.xxx namespace to save the file size between checks possibly?
Jul 11, 2018  • #3
Avatar from Gravatar.com
DAB42
30 discussion posts
The Reader seems to work but needs testers , Currently it will only report (text to speech) what event has occurred.
Later it could provide much more information to the player.

Again I am not a programmer, there is probably a better way to do this but is seems to work without slowing down performance

it does create one file called working.txt in C:\Users\"username"\Saved Games\Frontier Developments\Elite Dangerous

it will Monitor
Docking granted
Docked
undocked
discovery scanner
start fsd jump
end fsd jump

Code removed to make it easier to see most updated code
Jul 11, 2018 (modified Jul 14, 2018)  • #4
Avatar from Gravatar.com
DAB42
30 discussion posts
sorry Seems jump complete and jump started are having problems , found new object, docking granted, docked and undocked seems to work fine. must be the time between events affecting things
Jul 12, 2018 (modified Jul 12, 2018)  • #5
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
I hope you're able to get it sorted out, this looks like a very interesting script!
Jul 12, 2018  • #6
Avatar from Gravatar.com
DAB42
30 discussion posts
Good new the code has be reduced by a large amount , no more coping the file then trying to read it as using a stream I can now read it as its written,

New discoveries, Docking granted , docked and undocked seem to work every time , fsd jump started and complete still don't seem to work. Code still sloppy but very close

-- Code removed make it easier to use the most updated code version
Jul 13, 2018 (modified Jul 14, 2018)  • #7
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
That's fantastic! I'm sure other people in the Elite community will appreciate this as well.
Jul 13, 2018  • #8
Avatar from Gravatar.com
DAB42
30 discussion posts
It occurred to me other users could not use the code because the file path was set for my system.

the file path is now stored in the variable logpath and should automatically go to the save file for elite dangerous. if not change the path inside the quotes to match your save file location. The double \\ is required.

static string logpath = "C:\\Users\\"+ Environment.UserName +"\\Saved Games\\Frontier Developments\\Elite

Currently the script still only informs you that an event occurred but could soon contain Game data like system name , station details or you could launch other scripts from it.


Updated Code

Code

Jul 14, 2018 (modified Jul 26, 2018)  • #9
Avatar from Gravatar.com
DAB42
30 discussion posts
Should now report
Docking granted , Jump complete , undocked and found new discovery

Jump complete I use the to scan a system when i jump in
Docking granted I use this to start a macro to raise shield , send message that i am coming in and lower landing gear

all code in above up to date and working
Jul 14, 2018 (modified Jul 15, 2018)  • #10
Avatar from Gravatar.com
DAB42
30 discussion posts
The Latest update to the elite log reader boosting performance

Code

Aug 27, 2018  • #11
Avatar from Gravatar.com
rodrigo_vda
3 discussion posts
I'm really interested in your project, both in trying it, and helping develop it.

First of all, I've just purchased VoiceBot, how can I use your code?

Second, how about you create a github and collect people to work on it? =)
Oct 4, 2018  • #12
Avatar from Gravatar.com
DAB42
30 discussion posts
rodrigo_vda Very glad you liked the reader and want to help . the complete script is available
https://www.voicebot.net/Profiles/View/?ID=4d46883b-fbaf-411d-a00f-a78afaf7fc7c

Nut used GitHub before so not sure i set it up correctly but here is the link
https://github.com/CMDRdab42/EDLR

I am not a programmer so look forward to some help on this project
Oct 4, 2018  • #13
Avatar from Gravatar.com
rodrigo_vda
3 discussion posts
Quote:
rodrigo_vda Very glad you liked the reader and want to help . the complete script is available
https://www.voicebot.net/Profiles/View/?ID=4d46883b-fbaf-411d-a00f-a78afaf7fc7c

Nut used GitHub before so not sure i set it up correctly but here is the link
https://github.com/CMDRdab42/EDLR

I am not a programmer so look forward to some help on this project


Well, bad news, I'm not a programmer either, and I have never programmed in C# before, The closest I know is C++ but yeah, all are kind of similar, so I can do something.

However, I'm sure I'm far from a good c# programmer, but if I can help a little bit, maybe we could begin to create an alternative to EDDI :D

PS: I've never participated in a GitHub project before so idk how to proceed either, but maybe we should get some way to chat each other?
Oct 5, 2018  • #14
Avatar from Gravatar.com
DAB42
30 discussion posts
we are in great shape 2 non programmers writing a script using a platform we have no idea how to work with for a voice control program to play a game where the rule change all the time .

https://github.com/orgs/EDLR-for-voicebot/teams
Oct 5, 2018  • #15
Avatar from Gravatar.com
rodrigo_vda
3 discussion posts
What could go wrong?

well, hopefully eventually someone that knows his shit will join us haha
Oct 5, 2018  • #16
Avatar from Gravatar.com
DAB42
30 discussion posts
at least the program works and all we need is to make it better.
Oct 23, 2018  • #17
Avatar from Gravatar.com
DAB42
30 discussion posts
Made some performance changes now uses environment variable for file path so works on drive letters other then c:

Introduced delay loop in infinite loop to keep script open dramatically reducing cpu load

Code

Dec 1, 2018  • #18
Avatar from Gravatar.com
DAB42
30 discussion posts
Due to the large change in the journals after the recent up I have rewritten the journal reader with a different approach that seems to be working well. this is still a beta. still open to suggestion for improvement

Code

Dec 14, 2018  • #19
Was this helpful?  Login to Vote  Login to Vote
<< DiscussionsReply