Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off && SetLocal DisableDelayedExpansion
- title Skuly-ESO+TTC Launcher
- mode con: cols=52 lines=11
- for /f usebackq %%a in (
- `powershell -command "[Environment]::GetFolderPath('Personal')"`
- ) do (set "docs_folder=%%a")
- For /F "delims=" %%G In ('PowerShell -Command "&{((Get-ItemProperty "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Zenimax_Online\Launcher" -Name "InstallPath")."InstallPath")}"') Do Set "ESOPATH=%%G"
- set PriceTable="%docs_folder%\Elder Scrolls Online\live\AddOns\TamrielTradeCentre"
- GOTO MENU
- :MENU
- cls
- COLOR 0A
- ECHO 1 - Start ESO Launcher and Update PriceTable NA
- ECHO 2 - Start ESO Launcher and Update PriceTable EU
- ECHO 3 - Start TTC
- ECHO 4 - EXIT
- ECHO.
- SET /P M=Type menu number then press ENTER:
- IF %M%==1 GOTO STARTLAUNCHERNA
- IF %M%==2 GOTO STARTLAUNCHEREU
- IF %M%==3 GOTO STARTCLIENT
- IF %M%==4 GOTO :EOF
- :CLIENTALREADYSTARTED
- echo TCC Client Already Started.
- timeout 1 >nul
- GOTO MENU
- :LAUNCHERALREADYSTARTEDNA
- echo ESO Launcher Already Started.
- timeout 1 >nul
- GOTO PRICENA
- cls
- GOTO MENU
- :LAUNCHERALREADYSTARTEDEU
- echo ESO Launcher Already Started.
- timeout 1 >nul
- GOTO PRICEEU
- cls
- GOTO MENU
- :STARTCLIENT
- cls
- For /F "delims=" %%G In ('PowerShell -Command "&{((Get-Process client).Path)}"') Do Set "readclienttaskpath=%%G"
- SET SearchString=Elder Scrolls Online
- SetLocal EnableDelayedExpansion
- If /I Not "%readclienttaskpath%"=="!readclienttaskpath:%SearchString%=!" (GOTO CLIENTALREADYSTARTED) Else GOTO STARTCLIENTMAIN
- EndLocal
- cls
- :STARTCLIENTMAIN
- cls
- set clientpath="%docs_folder%\Elder Scrolls Online\live\AddOns\TamrielTradeCentre\Client\Client.exe"
- start "" %clientpath%
- timeout 1 >nul
- For /F "delims=" %%G In ('PowerShell -Command "&{((Get-Process client).Path)}"') Do Set "readclienttaskpath=%%G"
- SET SearchString=Elder Scrolls Online
- SetLocal EnableDelayedExpansion
- If /I Not "%readclienttaskpath%"=="!readclienttaskpath:%SearchString%=!" (echo TTC Client is now Started. && timeout 1 >nul && GOTO MENU) Else GOTO STARTCLIENTFAILED
- EndLocal
- :: NA
- :STARTLAUNCHERNA
- cls
- timeout 1 >nul
- For /F "delims=" %%G In ('PowerShell -Command "&{((Get-Process Bethesda.net_Launcher).Path)}"') Do Set "launchertaskpath=%%G"
- SET SearchString=%ESOPATH%
- SetLocal EnableDelayedExpansion
- If /I Not "%launchertaskpath%"=="!launchertaskpath:%SearchString%=!" (GOTO LAUNCHERALREADYSTARTEDNA) Else GOTO STARTLAUNCHERMAINNA
- EndLocal
- :STARTLAUNCHERMAINNA
- setlocal EnableDelayedExpansion
- :: Path to the launcher
- set "launcherpath=%ESOPATH%\Launcher\Bethesda.net_Launcher.exe"
- :: Launch the ESO Launcher
- start "" "%launcherpath%"
- cls
- :: Try to detect the running process up to 5 times
- set "retry=0"
- set "maxRetries=5"
- set "launchertaskpath="
- :DETECT_LOOP
- timeout /t 1 >nul
- For /F "delims=" %%G In ('PowerShell -Command "&{try {(Get-Process Bethesda.net_Launcher).Path} catch {}}"') Do Set "launchertaskpath=%%G"
- :: Check if the launcher task path contains the expected base path
- if /I not "!launchertaskpath!"=="!launchertaskpath:%ESOPATH%=!" (
- echo ESO Launcher successfully started.
- timeout /t 1 >nul
- goto PRICENA
- )
- :: Retry logic
- set /a retry+=1
- if !retry! lss %maxRetries% (
- goto DETECT_LOOP
- ) else (
- echo Launcher process not found or path mismatch after %maxRetries% attempts.
- goto STARTLAUNCHERFAILEDNA
- )
- endlocal
- :: NA END
- :: EU
- :STARTLAUNCHEREU
- cls
- timeout 1 >nul
- For /F "delims=" %%G In ('PowerShell -Command "&{((Get-Process Bethesda.net_Launcher).Path)}"') Do Set "launchertaskpath=%%G"
- SET SearchString=%ESOPATH%
- SetLocal EnableDelayedExpansion
- If /I Not "%launchertaskpath%"=="!launchertaskpath:%SearchString%=!" (GOTO LAUNCHERALREADYSTARTEDEU) Else GOTO STARTLAUNCHERMAINEU
- EndLocal
- :STARTLAUNCHERMAINEU
- setlocal EnableDelayedExpansion
- :: Path to the launcher
- set "launcherpath=%ESOPATH%\Launcher\Bethesda.net_Launcher.exe"
- :: Launch the ESO Launcher
- start "" "%launcherpath%"
- cls
- :: Try to detect the running process up to 5 times
- set "retry=0"
- set "maxRetries=5"
- set "launchertaskpath="
- :DETECT_LOOP
- timeout /t 1 >nul
- For /F "delims=" %%G In ('PowerShell -Command "&{try {(Get-Process Bethesda.net_Launcher).Path} catch {}}"') Do Set "launchertaskpath=%%G"
- :: Check if the launcher task path contains the expected base path
- if /I not "!launchertaskpath!"=="!launchertaskpath:%ESOPATH%=!" (
- echo ESO Launcher successfully started.
- timeout /t 1 >nul
- goto PRICEEU
- )
- :: Retry logic
- set /a retry+=1
- if !retry! lss %maxRetries% (
- goto DETECT_LOOP
- ) else (
- echo Launcher process not found or path mismatch after %maxRetries% attempts.
- goto STARTLAUNCHERFAILEDEU
- )
- endlocal
- :: EU END
- :STARTLAUNCHERFAILEDNA
- echo Failed to Start ESO Launcher.
- timeout 1 >nul
- GOTO PRICENA
- :STARTLAUNCHERFAILEDEU
- echo Failed to Start ESO Launcher.
- timeout 1 >nul
- GOTO PRICEEU
- :STARTCLIENTFAILED
- echo Failed to Start TTC Client. Is your Client.exe located in the Documents\Elder Scrolls Online\live\AddOns\TamrielTradeCentre\Client\ Folder?
- timeout 1 >nul
- GOTO MENU
- :PRICENA
- cls
- IF EXIST %PriceTable%\PriceTableEU.lua DEL %PriceTable%\PriceTableEU.lua
- curl -s -o "PriceTable.zip " https://us.tamrieltradecentre.com/download/PriceTable
- tar -xf PriceTable.zip -C %PriceTable% && echo PriceTableNA Updated
- del PriceTable.zip
- timeout 1 >nul
- GOTO MENU
- :PRICEEU
- cls
- IF EXIST %PriceTable%\PriceTableNA.lua DEL %PriceTable%\PriceTableNA.lua
- curl -s -o "PriceTable.zip " https://eu.tamrieltradecentre.com/download/PriceTable
- tar -xf PriceTable.zip -C %PriceTable% && echo PriceTableEU Updated
- del PriceTable.zip
- timeout 1 >nul
- GOTO MENU
- :EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement