[IC/WIP] CloudMoney - Check your balance everywhere :)

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Droddo
Posts: 1
Joined: Sun, 8. Dec 19, 19:12

[IC/WIP] CloudMoney - Check your balance everywhere :)

Post by Droddo » Sun, 8. Dec 19, 20:26

This is an interest check to see if this feature is interesting enough, putting all the code to the GitHub repo will take some efforts

Background:
I bought X4 couple of weeks ago

I play in a very relaxed way, and to be honest, the biggest gratification came from the bankroll constantly raising due to the trade/mining of my station.

At a certain point, I've found myself alt-tabbing now and then to check my balance, and I become tired of this, so I pick my weekend to develop a small thing that I'm going to present here. I'm not sure if this will be used at all by anyone, but this thing may open various options for out of the game experiences. I'm absolutely noob with X4 and which kind of information we can gather from it.

The bottom line, my goal was printing the In-game balance on a small LCD connected to Arduino.

Challenge accepted, challenge completed : )

Image

To give an overview of the project:
There's an X4 mod that is in charge to write the balance to a debug log file every 60 seconds, which requires X4 to be launched via

Code: Select all

-debug all -logfile debuglog.txt
An exe file scrapes the debug log, fetches the information about the balance and sends it to the cloud (more on this on the next line). When the send is completed it deletes the file (append mode on the debug mod cause the file to be recreated each time)

On Heroku is deployed a very small app server, which supports a couple of operation (store/retrieve of the balance). This information is persisted on Redis which is used by the backend.

The information can be retrieved as a JSON item via GET call over the internet (which my Arduino is doing). The URL of my pilot current balance now is: https://floating-river-62652.herokuapp. ... SE-TAID-55

Since the information is accessible over the Internet via a GET, you can easily build a notification ticker/ android or iOS app / whatever.

I wanted to share this approach of exporting data from within the game to outside, I'm sure other mods more knowledgable than me could create wonders

I'm unsure how many would be willing to use this in this form, anyhow for me has been a really nice weekend of learning. If anyone wants to give it a try, post here. If I see traction I'll post the sources to github


tezboyes
Posts: 19
Joined: Tue, 1. Apr 08, 20:52
x4

Re: [IC/WIP] CloudMoney - Check your balance everywhere :)

Post by tezboyes » Wed, 5. May 21, 19:40

Which reminds me that there used to be a couple of X3 mods that could display data on the Logitech G series keyboards.

User avatar
beko
Posts: 53
Joined: Thu, 11. Jun 20, 21:14
x4

Re: [IC/WIP] CloudMoney - Check your balance everywhere :)

Post by beko » Thu, 6. May 21, 09:45

I'm tinkering with something similar. Dragging information out of the game (and back in) is not so easy and abusing the logfile for this is a burden on your disk and a one way road.

The best approach is probably the PipeServer by SirNukes but that's Windows only (for now). Still checking my options on that but I'd have to reimplement the Pipe part itself.

Could make some quick n dirty progress with the REST server (alpha, proof of concept) by Alia5 though.

I'm thinking "cockpit" https://beko.famkos.net/2021/05/02/auto-draft/ :D

tezboyes
Posts: 19
Joined: Tue, 1. Apr 08, 20:52
x4

Re: [IC/WIP] CloudMoney - Check your balance everywhere :)

Post by tezboyes » Thu, 6. May 21, 18:10

I've found the old thread, which references the original one by Cycrow - G15 Logging.
Looks like that was a timed event which dumped a few days items to a specific logfile.

Yeah I agree a Pipe based solution seems a better way to go. Really it's time-bound data.

Though I've just been reading the X4 Rest Server thread that takes another approach.

With a reader on the other end that can split it and let it be used in a number of different ways.

Keyboard display would be great for me, I still use my G15 :)
I've seen others mention sending it over to a Pi.
Maybe even an old smartphone.
Some people may want to store it, and see changes over time.

But all those end-uses can be picked up be folks who want it that particular way.

Post Reply

Return to “X4: Foundations - Scripts and Modding”