kevinlekiller / eso-linux-launcher

Launcher for Elder Scrolls Online on Linux with a addon updater and a TTC price table updater.
GNU General Public License v2.0
13 stars 5 forks source link

[REQUEST] Import HarvestMap files #3

Open WrayOfSunshine opened 3 years ago

WrayOfSunshine commented 3 years ago

I'm not very familiar with shell scripting, but it looks like it should be feasible to add in scripting to (optionally) merge HarvestMap data - their powershell script is runnable if you install powershell for linux, but I suspect everything it does is reproducible in a bash script, negating the need to rely on a powershell script.

kevinlekiller commented 3 years ago

I don't play ESO anymore, but if you link that script I can have a look and try to write something up you can test.

kevinlekiller commented 3 years ago

I looked at the addon, there's a bash script in there DownloadNewData.command it looks like it's for Mac OS, but if you set the path (basedir) to your ESO directory it should work on Linux, it doesn't seem to do anything that wouldn't work on Linux.

If it errors out, let me know and we'll try to get it working.

Star-X555 commented 3 years ago

I tested the HarvestMap mac command on Linux, but it seems that whatever arcane coding wizardry was intended for HarvestMap's data collection doesn't work with the mac script any more.

I did however discover that it is possible to set up the powershell script to run through ell.sh by simply calling for pwsh to run the powershell script. In my case I just dropped the DownloadNewData.ps1 file into ESO Linux Launcher's directory and renamed it hm.ps1, and added a new function to ell.sh to check for HarvestMap updates in between TTC and Addon updates, with a proper toggle as well. Example here:

...
# Fetch TTC price table before starting ESO. Set to 0 to disable.
UPDATE_TTC=${UPDATE_TTC:-1}
# Fetch merged HarvestMap data before starting ESO.  Set to 0 to disable.
UPDATE_HM=${UPDATE_HM:-1}
# Update addons before starting ESO. Set to 0 to disable.
UPDATE_ADDONS=${UPDATE_ADDONS:-1}
...
CWD=$(dirname $(realpath $0))
if [[ $UPDATE_HM == 1 ]] && [[ -f $CWD/hm.ps1 ]]; then
    pwsh "$CWD/hm.ps1"
fi
...

DownloadNewData.ps1 is possibly not legally allowed to be added directly to the launcher as hm.ps1, so figuring out how the command works may be necessary to making it able to be bundled with this git project. Alternatively, though, simply asking the user to copy DownloadNewData.ps1 to the directory as hm.ps1 would work too. The only change really required in DownloadNewData.ps1 is to modify the following line to point to your compatdata directory instead, like so:

...
try {
    # the addon is not always located in ~/Documents, i.e. when OneDrive is active.
    # so let's first try with relative paths since this script should be in the AddOns folder
    cd "../../../.." # move to the documents folder (assuming the script is in the HarvestMapData addon folder) 
    # ^ replace THIS line's path with one leading straight to your Documents folder that your ESO prefix in Steam uses, which will be "(your steam library path)/compatdata/306130/pfx/drive_c/users/steamuser/My Documents"
...

Also, if running as a shortcut, make absolutely sure to delete the following line from DownloadNewData.ps1 if you want to actually run the game:

...
            echo "Finished merging the files."
            pause # delete this
            exit
...