Skip to content

Commit

Permalink
v1.6 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaption committed Feb 21, 2024
1 parent 8273900 commit 4311284
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions LunarClientTools.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@rem LunarClientTools v1.5 by Vaption
@rem LunarClientTools v1.6 by Vaption
@rem https://github.com/Vaption/LunarClientTools
@rem Please report any issues on Github

@ECHO OFF
TITLE LunarClientTools v1.5
TITLE LunarClientTools v1.6

NET SESSION >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
Expand Down Expand Up @@ -52,7 +52,7 @@ echo 3. Profile Management Options
echo 4. Switch LunarClient's GPU to Dedicated/Integrated
echo 5. Exit
echo.
set /P M=[96mType[0m [91m1-11[0m [96mand then press enter[0m[91m:[0m
set /P M=[96mType[0m [91m1-5[0m [96mand then press enter[0m[91m:[0m
if %M%==1 goto :cache-rem
if %M%==2 goto :lc-folder
if %M%==3 goto :json-menu
Expand All @@ -72,16 +72,15 @@ echo ## Lunar Client Tools Script
echo ## https://github.com/Vaption/LunarClientTools ##
echo ###################################################################
echo.
echo.
echo.
echo Profile Management Options
echo.
echo 1. List All Present Profiles in the Directory
echo 2. Autodetect Profiles and Replace Current Profile Manager
echo 3. Manual Profile Manager Generator
echo 4. Export Your Profiles to Desktop
echo 5. Cancel
set /P M=Type 1-4 and then press enter:
echo.
set /P M=Type 1-5 and then press enter:
if %M%==1 goto :json-list
if %M%==2 goto :json-auto
if %M%==3 goto :json-manual
Expand All @@ -106,7 +105,7 @@ set count=0
for /d %%G in ("%path%\*") do (
set /a count+=1
)
echo [92mYou have a total of %count% profiles:[0m
echo [92mYou have a total of %count%/8 profiles:[0m
echo.

for /d %%G in ("%path%\*") do (
Expand All @@ -128,23 +127,29 @@ set "settingsFolder=%userprofile%\.lunarclient\settings\game"
if not exist "%settingsFolder%" (
echo The settings folder does not exist in .lunarclient
echo LCT was unable to detect any profile in your settings directory.
pause
pause >nul
exit /b
)

echo Scanning the settings folder...
timeout /t 3 /nobreak >nul
set /a totalProfiles=0
for /d %%i in ("%settingsFolder%\*") do (
set /a totalProfiles+=1
)

if %totalProfiles% gtr 8 (
echo Error: More than eight profiles are present!
echo Please navigate to .lunarclient\settings\game and remove some profiles before running the command.
pause >nul
exit /b
) else (
goto :json-auto-action
)
:json-auto-action
echo Found %totalProfiles% profiles in the settings folder.

echo Generating profiles...
echo.
timeout /t 3 /nobreak >nul

set "jsonContent=["

for /d %%i in ("%settingsFolder%\*") do (
Expand All @@ -158,25 +163,30 @@ for /d %%i in ("%settingsFolder%\*") do (
set "jsonContent=!jsonContent!,"
)
)

set "jsonContent=!jsonContent!]"

> "%userprofile%\.lunarclient\settings\game\profile_manager.json" echo !jsonContent!

echo Successfully generated and replaced profile_manager.json
echo.
echo.
pause
pause >nul
cls
goto :menu

:json-manual
@echo off
setlocal enabledelayedexpansion

echo [36mEnter the total number of profiles you want to add:[0m
echo [36mEnter the total number of profiles you want to add (Max=8):[0m
set /p totalProfiles=

if %totalProfiles% gtr 8 (
echo Error: Maximum number of profiles exceeded. Please enter a number between 1 and 8.
pause >nul
cls
goto :menu
)

echo Generating profiles...
echo.

Expand Down

0 comments on commit 4311284

Please sign in to comment.