Adamcake / Bolt

An alternative launcher for your favourite MMO
GNU Affero General Public License v3.0
122 stars 18 forks source link

Some way to quickly launch to a specific character? (Feature request/feature offer) #43

Closed h0dgep0dge closed 1 month ago

h0dgep0dge commented 1 month ago

I'm interested in writing in a way to launch runelite through bolt without messing with the interface, just through command line arguments, for one click launching through a menu or something silly like a i3wm keybinding.

I've already written this into my one-python-file launcher, and i'd be interested in trying to write it right into Bolt, so I wanted to ask for some direction or feedback on how the original author would want this done (just calling an existing bolt binary with arguments, using some kind of inter-process communication with the bolt daemon, writing a new stand-alone program that can read the bolt config and do what it needs to do from there, or something else) or if this would even be possible in a satisfactory way.

Adamcake commented 1 month ago

It would be tricky. The most obvious problem is that the launcher UI is responsible for renewing login credentials, and checking and downloading game updates. So you'd need still to create the launcher window, but not call Show() on it. You'd probably want to add some url params like "action" that the page's javascript code can pick up on and start trying to do something automatically instead of waiting for user input.

Then, you'd need to come up with a set of command line arguments you can use to specify which game you want to play and which account you want to play on (remember, Bolt supports multiple jagex accounts and multiple game accounts per each jagex account.)

There are a few things that could go wrong while the UI is doing its thing, which you'd need to think of a way of handling. Off the top of my head:

And lastly there's the issue that only one Bolt process is allowed to run at any time due to the oauth credentials regularly changing. So if you tried to run several launch commands at once, or while already running the normal UI, then they would fail. Not sure if you'd necessarily need to do anything about this.

h0dgep0dge commented 1 month ago

To be honest I hadn't really dug deep into how Bolt is architected, and it does sound like restructuring for such a niche usecase is a juice not worth the squeeze situation. I'll probably just focus on making my thing more compatible with Bolt, because that interface for logging in is 1000x better. Thanks for your reply, you're doing awesome work!