Skip to content

Commit

Permalink
Remove uneccessary check
Browse files Browse the repository at this point in the history
  • Loading branch information
Loudbooks committed Jun 19, 2024
1 parent bb43e3b commit daa0ad0
Showing 1 changed file with 31 additions and 50 deletions.
81 changes: 31 additions & 50 deletions scripts/logbook/logbook.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,6 @@ if "%discord_username%"=="" (
goto check_username
)

:check_log_type
echo.
echo Confirm your log type:
echo 1) Latest Log
echo 2) Launcher Log
set /p log_type=Enter your choice:

if "%log_type%"=="1" set log_name=latest
if "%log_type%"=="2" set log_name=launcher

if not "%log_name%"=="latest" if not "%log_name%"=="launcher" (
echo.
echo Invalid log type. Please try again.
goto check_log_type
)

:check_launcher_type
echo.
echo Confirm your launcher:
Expand All @@ -50,6 +34,23 @@ if "%launcher_type%"=="5" goto technic

:official
setlocal enabledelayedexpansion

:check_log_type
echo.
echo Confirm your log type:
echo 1) Latest Log
echo 2) Launcher Log
set /p log_type=Enter your choice:

if "%log_type%"=="1" set log_name=latest
if "%log_type%"=="2" set log_name=launcher

if not "%log_name%"=="latest" if not "%log_name%"=="launcher" (
echo.
echo Invalid log type. Please try again.
goto check_log_type
)

if %log_name%==latest (
set selected_directory=%appdata%\.minecraft\logs\latest.log
set log_name=Latest Log
Expand All @@ -71,7 +72,7 @@ if %index%==1 (
echo.
echo No CurseForge installations found.
pause
goto check_log_type
goto check_launcher_type
)

echo.
Expand All @@ -87,13 +88,8 @@ set /p selected_index=Enter the index of the installation you are using:
set /a index=1
for /d %%d in ("%homedrive%%homepath%\curseforge\minecraft\Instances\*") do (
if !index!==%selected_index% (
if %log_type%==launcher (
set selected_directory=%homedrive%%homepath%\curseforge\minecraft\Instances\%%~nxd\logs\launcher_log.txt
set log_name=CurseForge Launcher Log ^(%%~nxd^)
) else (
set selected_directory=%homedrive%%homepath%\curseforge\minecraft\Instances\%%~nxd\logs\latest.log
set log_name=CurseForge Latest Log ^(%%~nxd^)
)
set selected_directory=%homedrive%%homepath%\curseforge\minecraft\Instances\%%~nxd\logs\latest.log
set log_name=CurseForge Latest Log ^(%%~nxd^)
)
set /a index+=1
)
Expand All @@ -112,7 +108,7 @@ if %index%==1 (
echo.
echo No Prism installations found.
pause
goto check_log_type
goto check_launcher_type
)

echo.
Expand All @@ -129,13 +125,8 @@ set /a index=1

for /d %%d in ("%appdata%\PrismLauncher\instances\*") do (
if !index!==%selected_index% (
if %log_type%==launcher (
set selected_directory=%appdata%\PrismLauncher\instances\%%~nxd\.minecraft\logs\launcher_log.txt
set log_name=Prism Launcher Log ^(%%~nxd^)
) else (
set selected_directory=%appdata%\PrismLauncher\instances\%%~nxd\.minecraft\logs\latest.log
set log_name=Prism Latest Log ^(%%~nxd^)
)
set selected_directory=%appdata%\PrismLauncher\instances\%%~nxd\.minecraft\logs\latest.log
set log_name=Prism Latest Log ^(%%~nxd^)
)
set /a index+=1
)
Expand All @@ -154,7 +145,7 @@ if %index%==1 (
echo.
echo No Modrinth installations found.
pause
goto check_log_type
goto check_launcher_type
)

echo.
Expand All @@ -170,13 +161,8 @@ set /p selected_index=Enter the index of the installation you are using:
set /a index=1
for /d %%d in ("%appdata%\com.modrinth.theseus\profiles\*") do (
if !index!==%selected_index% (
if %log_type%==launcher (
set selected_directory=%appdata%\com.modrinth.theseus\profiles\%%~nxd\logs\launcher_log.txt
set log_name=Modrinth Launcher Log ^(%%~nxd^)
) else (
set selected_directory=%appdata%\com.modrinth.theseus\profiles\%%~nxd\logs\latest.log
set log_name=Modrinth Latest Log ^(%%~nxd^)
)
set selected_directory=%appdata%\com.modrinth.theseus\profiles\%%~nxd\logs\latest.log
set log_name=Modrinth Latest Log ^(%%~nxd^)
)
set /a index+=1
)
Expand All @@ -195,7 +181,7 @@ if %index%==1 (
echo.
echo No Technic installations found.
pause
goto check_log_type
goto check_launcher_type
)

echo.
Expand All @@ -213,13 +199,8 @@ set /a index=1

for /d %%d in ("%appdata%\.technic\modpacks\*") do (
if !index!==%selected_index% (
if %log_type%==launcher (
set selected_directory=%appdata%\.technic\modpacks\%%~nxd\logs\launcher_log.txt
set log_name=Technic Launcher Log ^(%%~nxd^)
) else (
set selected_directory=%appdata%\.technic\modpacks\%%~nxd\logs\latest.log
set log_name=Technic Latest Log ^(%%~nxd^)
)
set selected_directory=%appdata%\.technic\modpacks\%%~nxd\logs\latest.log
set log_name=Technic Latest Log ^(%%~nxd^)
)
set /a index+=1
)
Expand All @@ -232,14 +213,14 @@ if "%selected_directory%"=="" (
echo.
echo Log not found: %selected_directory%
pause
goto check_log_type
goto check_launcher_type
)

if not exist "%selected_directory%" (
echo.
echo Log not found: %selected_directory%
pause
goto check_log_type
goto check_launcher_type
)

echo.
Expand Down

0 comments on commit daa0ad0

Please sign in to comment.