Jarvis - A Neo4j /Java (and Elite OCR) Powered CLI

* the damn thing hates me for being a noon on the forums so the github link will be added somewhere*
github.com/jrosocha/jarvis

If you are a Java dev, or someone who is into Neo4j, that little github link will be a fun exercise.

I love EliteOCR and TradeDangerous. I was using that pair for a while. But I'm another developer so I figured this would be a great opportunity to learn how Neo4J works. For those of you who don't know, Neo4J is a graph database. A graph is conceptually nodes and edges, which is a bit different conceptually from an old fashioned relational db with its rows, columns, and relationships. And the chance to write a CLI (way outside of my web comfort zone) could not be ignored.

So my little project was born.

How am I different from TradeDangerous?

1. Its named Jarvis. I thought it was clever because Jarvis is Java based, and runs from a Jar, and its your little trading butler.

2. Jarvis uses a graph DB. By default, this db is local, bit if you edit the config file, you can use an external db. This would allow you to use the Neo4J admin interface to run cypher and explore the graph visually.

3. Jarvis integrates tightly with Elite OCR. If you are not using Elite OCR, don't use Jarvis. Elite OCR creates CSV files with its export that go to a configured folder. Assuming you have Jarvis configured correctly, typing 'ocr' will scan that directory and add that trading/station data to the graph.

4. Jarvis is 'mostly' station based. There are some commands (like 'path') taht base off of a system, but im usually sitting at a station. So that is where I programmed from.

5. Jarvis depends on previous commands. If you type 'station goo' and Gooch Hub is the only matching staton in your graph, it will be selected as your 'from' or 'start' station for all future commands, unless specified.

6. Jarvis has terrible command names. Like go, go2, gon, go2n, gos, etc, etc. Type 'tab' or help <command>.

7. Cygwin & Jarvis don't mix. I don't know why yet.

8. Jarvis is not a shared DB. You start with nothing. Nada. If you have a saved collection of Elite OCR CSV files, you can load those. It actually sort of depends on that. If you were to load every station in the game, I'm not sure how Neo4j would handle all those edges. I'm still improving this stuff. I'm pretty sure just the FRAMESHIFT edges from every point to every other point would take several hours to load.

9. Jarvis updates a whole station. Not just a commodity. So any commodity exchange in that station gets wiped, and replaced with the new data from the latest OCR. No orphaned exchanges this way.

10. Jarvis likes giving the 5 best suggestions. As he is a brute force salesman, he kind of is as slow as possibel already :)

So here is the rough timeline on how I use it.

Usually I roll up on a station and do my f10/screenshot Elite OCR work. Once the CSV is in the directory i switch to Jarvis and type:

jarvis> ocr

To make sure the station looks cool, and so I switch to it as my active station, I then type:

jarvis> st hui

Jarvis shows me the station and its data. My example would be HUI MINES. Now I usually do a scan of the best possible trade considering a single station stop.

jarvis> gon

You can add --jumps 1-n, thus the go-n, but I don't recommend going much further out than 3 until I improve that performance, if its possible. It can take a while. Default = 2.
So Jarvis now gives you the 5 best options within n jumps of your ly range. You have go ( a one jump, 1 station solution), go2 (a 2 station solution within one jump of each other), gon (a 1 station n jump solution), and go2n (a 2 stations within n jumps of each other solution). I could combines them into a mega command but this was more convenient for me to type.

If you dont want to use the in game map, you can type:

jarvis> path --from 'system a' --to 'systemb'

to get the shortest route between systems. I'm still improving that command. I want it to use the same station based syntax too.

Sometimes I take a job at a station and want a quick review of where I am going and what I should buy while Im here and going there. That one is:

jarvis> gos --to gooch

Etc, etc. Just type 'tab' for help.

I've got a lot of work to do, but this is more for me than you. But if it interests you, feel free to give Jarvis a try and make suggestions or pull requests or whatever!

The install directions are in the README on the github page. It boils down to downloading the code, running gradlew.bat or gradlew, and then copying the resulting build/install/jarvis directory somewhere you want it. Edit the jarvs-config.json file to point to your elite ocr output dir. Then go to /your/dir/jarvis/bin/ and run ./jarvis.bat. Its important you be in the dir first so jarvis has a good place to start looking for the stuff he needs to run.

Enjoy.

Dogfish
 
Back
Top Bottom