#!/usr/bin/env bash# Check if the prefix path is validif[[$# -ne 1]];thenecho"Usage: $(basename $0) /path/to/wine/prefix"exit1elif[[ ! -e "$1/system.reg"]];thenecho"Not a valid Wine prefix"exit1fi# Look for PLayer.logproton_path="/drive_c/users/steamuser/AppData/LocalLow/SunBorn/EXILIUM/Player.log"wine_path="/drive_c/users/$USER/AppData/LocalLow/SunBorn/EXILIUM/Player.log"if[[ -e "$1$proton_path"]];thenlog_path="$1$proton_path"elif[[ -e "$1$wine_path"]];thenlog_path="$1$wine_path"elseecho"Log file not found"echo"Make sure it's the right prefix and that you've booted the game at least once"exit1fi# Check that the user isn't a dorkuser_id=$(grep 'key_token_now'$log_path| sed 's/.*uid":"\([a-zA-Z0-9=]*\).*/\1/')if[[ -z $user_id]];thenecho"No player data found"echo"Log into the game at least once, dork!"exit1fi# Detect the serverserver_url=$(grep -m 1'gf2-zoneinfo'$log_path| sed 's/.*gf2-zoneinfo-\([a-z]*\).*/\1/')if[[$server_url=='us']];thenserver="dw"elif[[$server_url=='intl']];thenserver="hi"elif[[$server_url=='asia']];thenserver="ha"elif[[$server_url=='jp']];thenserver="hj"elif[[$server_url=='kr']];thenserver="hk"elseecho"Server not found!"echo"Please select a server [1-5] or press any other key to cancel"servers=("Darkwinter""Haoplay (Global)""Haoplay (Asia)""Haoplay (JP)""Haoplay (KR)")select servers in"${servers[@]}"docase$REPLYin1)echo"$servers"server="dw"break;;2)echo"$servers"server="hi"break;;3)echo"$servers"server="ha"break;;4)echo"$servers"server="hj"break;;5)echo"$servers"server="hk"break;; *)exit1;;esacdonefi# Grab the tokentoken=$(grep 'key_token_now'$log_path| sed 's/.*key_token_now":"\([^"]*\).*/\1/')echo"Copy the generated JSON and import your data in https://exilium.moe/import"echo""echo"JSON:"echo"{\"uid\":\"$user_id\",\"server\":\"$server\",\"token\":\"$token\"}"