X3ne / hsrpc

A go program to add Discord RPC features to Honkai Star Rail (locations, characters, bosses, simulated universe, forgotten hall, 130+ menus supported)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

project-image

Add Honkai Star Rail status to Discord with locations, characters, bosses, simulated universe, forgotten hall, 130+ menus supported and more.

🖼️ Project Screenshots:

project-screenshot

💻 Platforms:

  • Windows
  • Linux
  • MacOs

🗣️ Languages:

  • English
  • French

🤓 Technical information:

This program works with tesseract, an open source text recognition software. hsrpc extracts no data from the game and is based solely on what tesseract recognizes on the window (so some results may be wrong)

App folder

This app create a folder hsrpc inside C:\Users\<user>\AppData\Roaming. This folder is used to store config, logs and files needed to make this app working.

⚠️ If your app crashes after an update, please delete your config.txt file and restart the app

🛠️ Installation Steps:

1. Install tesseract-ocr

tesseract github

or with choco

choco install tesseract

2. Download hsrpc.exe

Download the file named hsrpc_windows_amd64.zip and extract the executable (.exe) to the desired location

Latest release

3. Launch

Just run the executable and off you go

🏗️ Build Steps:

1. Clone this project

git clone https://github.com/X3ne/hsrpc

2. Install go-winres

go install github.com/tc-hib/go-winres@latest

3. Run go generate (used to bundle static files and set executable icon)

go generate ./...

4. Build

go build -ldflags="-X github.com/X3ne/hsrpc/src/consts.Version=X.X.X -H=windowsgui"

⚙️ Configuration:

When you launch the .exe file you can configure some settings with the GUI app. To open the GUI just go to your windows systray and right click to open the config.

Settings:

Player UID: Enter your hsr UID to display your level and player name (you can disable both with the 2 checkboxes). If no Player Name is entered, this value is used to detect whether your Trailblazer is the currently selected character.

Player name: Enter your player name to activate Trailblazer detection (this value is optional if you've entered your UID).

Loop time: This is the time that elapses between two loop executions. If you're experiencing performance issues, you can increase this value (in milliseconds).

Preprocess treshold: You can adjust this value by checking screenshots inside C:\Users\<user>\AppData\Roaming\hsrpc\tmp (you need to see the text on the images when using the app). If you have Lost in the space-time continuum status this means you may need to lower this value.

Tesseract path: You can change the path to tesseract.exe if the default path does not match your tesseract installation.

Window class and Window name: These values should only be changed if your game window is not found (you can check that the loop time is 20s in the Presence tab, or simply by checking the application logs). To find these values, you need to :

  • Install WinSpy++ and launch the .exe
  • Enlarge window
  • Launch your task manager, right-click on Name and activate PID if it's not already activated
  • Find the Star Rail process and extend it, pick the Star Rail process PID
  • Return to WinSpy++ and find the PID from the previous step, double-click and select the UnityWndClass window. Now you have the Caption and Class, these values must be entered in Window name and Window class respectively

🪲 Known issues:

IMPORTANT:

  • Merge config file to avoid application crashes when config changes between different versions

Menus:

  • Data bank tab is not detected

  • Achievements tab is not detected

  • Unfortunately, the new update has broken other menus for no reason (only on resolutions below 2560)

  • Fix gosec errors

  • Sometimes, the position of the selected character is not the right one (especially when the background is too bright, e.g. on Jarilo-VI when there's snow in the background)

  • I don't have these characters, but Dan Heng Imbibitor Lunae and Topaz and Numby seem broken with ocr detection (due to their long name)

  • The results are very poor on the Outlying Snow Plains

⚒️ Improvements:

  • Add support for more game resolution (tested with fullscreen 1920x1080, 2560x1080 & windowed 1768x992)
  • Add more game menus status
  • Clean some code
  • Create scripts to create data csv
  • Build to .exe
  • Add support for Simulated Universe
  • Add support for the forgotten hall (add some data to detect the current level)
  • Add support for Calyx
  • Add support for Cavern of corrosion
  • Add support for Echo of war
  • Add support for cut scenes
  • Add support for the Trailblazer
  • I want to add more infos for the selected character in the character tab (like the character name, level...)
  • Auto calculate coords based on app resolution
  • Reimplement the personalization of coordinates in GUI
  • Add support for the Parlor car
  • Add support for bosses

GUI app:

  • Add persistent state to GUI configuration
  • Add field validation

🎨 Credits:

The assets and data for the discord presence come from the Honkai Star Rail wiki

The app icon by mhesagnta

Image assets are intellectual property of HoYoverse, © All rights reserved by miHoYo

About

A go program to add Discord RPC features to Honkai Star Rail (locations, characters, bosses, simulated universe, forgotten hall, 130+ menus supported)

License:MIT License


Languages

Language:Go 100.0%