Jump to content
Sign in to follow this  
Killbrid

Is it possible to create multiple different clients of this game with different cached loadouts

Recommended Posts

EDIT: Answered question by myself by making one

 

After a long bit of coding I got a long and (almost) clean solution. If anyone wants a loadout hopper I just made one.

 

Paste this code into a batch file in the same folder as your SPK.jar (requires that your spawnpk be named SPK.jar)

CURRENT: v1.0.02

Spoiler

@echo off
setlocal EnableDelayedExpansion
if exist lastUsed.txt (
    set /p lastUsed=<"lastUsed.txt"
)
if not exist cachePath.txt (
    if exist C:\Users\%username%\.spawnpk-data (
        >"cachePath.txt" echo C:\Users\%username%\.spawnpk-data
        set cachePath=C:\Users\%username%\.spawnpk-data
    )
)
if not exist SpawnPKLoadouts (
    md "SpawnPKLoadouts"
)
if not exist cachePath.txt (
    cls
    echo Cache folder was not automatically found.
    echo.
    echo Cache folder path will look something like "C:\Users\%username%\.spawnpk-data"
    set /p cachePath=What is your cache folder path? 
    >"cachePath.txt" echo %cachePath%
)
set /p cachePath=<"cachePath.txt"
set /p saveLastUsed=Do you want for your last used client to be saved over %lastUsed%?(y^|n^) 
if "%saveLastUsed%" == "y" (
copy "%cachePath%\loadout.conf" "SpawnPKLoadouts\%lastUsed%\loadout.conf"
)
:startOfFileFail
cls
echo Please enter a proper input.
goto skipClear
:startOfFile
cls
:skipClear
echo Current folder path:
echo Cache: "%cachePath%"
set /p whatDo=What would you like to do? (Clone Loadout Files[c]) (Start Game (Change Cache File[f]) (Exit[e]) (Help[h])
if "%whatDo%" == "c" (
    goto cloneLoadouts
)
if "%whatDo%" == "f" (
    goto RootFile
)
if "%whatDo%" == "s" (
    goto startGame
)
if "%whatDo%" == "h" (
    goto help
)
if "%whatDo%" == "e" (
    exit
)
goto startOfFileFail

:help
cls
echo This page explains the function of each of the 5 key presses on start.
echo.
echo (Clone Loadout Files[c])
echo This function takes the current cache in the cache file and uploads it into a new folder 
echo name allowing for another loadout bar customization.
echo.
echo.
echo (Start Game)
echo This function allows you to start the game with either a new (deletes the current cache in 
echo the game generating a new one) and starts as that. Or you can select one of the previously
echo made folders from the clone functione allowing you a custom loadout bar.
echo.
echo.
echo (Change Cache File[f])
echo This changes the cache file, yours currently "%cachePath%", to whatever
echo you may want it to be if it's missplaced.
echo.
echo.
echo (Exit[e])
echo Exits the client starter.
echo.
echo.
echo (Help[h])
echo Brings up this menu
echo meta as fuck by the way.
echo.
pause
:rootFile
cls
echo Cache folder path will look something like "C:\Users\username\.spawnpk-data"
set /p cachePath=What is your cache folder path: 
>"cachePath.txt" echo %cachePath%
goto startofFile

:retryStart
cls
echo That loadout file does not exist.
echo.
goto skipClear2
:startGame
cls
:skipClear2
echo Warning, if you do not have a last used file the current loadout saved in cache will be deleted.
set /p usingLoadout=What loadout file would you like to use on game launch? (new^|Named Loadout^) 
if "%usingLoadout%" == "new" (
    copy "%cachePath%\loadout.conf" "SpawnPKLoadouts\%lastUsed%\loadout.conf"
    del "%cachePath%\loadout.conf"
    goto spkStart
)
echo SpawnPKLoadouts\%usingLoadout%\loadout.conf
echo %cachePath%\loadout.conf
copy "SpawnPKLoadouts\%usingLoadout%\loadout.conf" "%cachePath%"
if errorlevel 1 (
    goto retryStart
)
>"lastUsed.txt" echo %usingLoadout%
goto skipClear3
:spkStart
del "%cachePath%\loadout.conf"
del lastUsed.txt
:skipClear3
start SPK.jar
exit
:cloneLoadouts
set /p nameOfNewFile=What would you like the name of the new loadout file to be called? 
md SpawnPKLoadouts\%nameOfNewFile%
copy "%cachePath%\loadout.conf" "SpawnPKLoadouts\%nameOfNewFile%
goto startOfFile

OLD VERSIONS:

Spoiler
Spoiler


@echo off
setlocal EnableDelayedExpansion
if exist lastUsed.txt (
	set /p lastUsed=<"lastUsed.txt"
)
if not exist cachePath.txt (
	if exist C:\Users\%username%\.spawnpk-data (
		echo C:\Users\%username%\.spawnpk-data > "cachePath.txt"
		set cachePath=C:\Users\%username%\.spawnpk-data
	)
)
if not exist SpawnPKLoadouts (
	md "SpawnPKLoadouts"
)
if not exist cachePath.txt (
	cls
	echo Cache folder was not automatically found.
	echo.
	echo Cache folder path will look something like "C:\Users\%username%\.spawnpk-data"
	set /p cachePath=What is your cache folder path? 
	echo %cachePath% > "cachePath.txt"
)
set /p cachePath=<"cachePath.txt"
set /p saveLastUsed=Do you want for your last used client to be saved over %lastUsed%?(y^|n^) 
if "%saveLastUsed%" == "y" (
copy "%cachePath%\loadout.conf" "SpawnPKLoadouts\%lastUsed%\loadout.conf"
)
:startOfFileFail
cls
echo Please enter a proper input.
goto skipClear
:startOfFile
cls
:skipClear
echo Current folder path:
echo Cache: "%cachePath%"
set /p whatDo=What would you like to do? (Clone Loadout Files[c]) (Start Game[s] (Change Cache File[f]) (Exit[e]) (Help[h])
if "%whatDo%" == "c" (
	goto cloneLoadouts
)
if "%whatDo%" == "f" (
	goto RootFile
)
if "%whatDo%" == "s" (
	goto startGame
)
if "%whatDo%" == "h" (
	goto help
)
if "%whatDo%" == "e" (
	exit
)
goto startOfFileFail

:help
cls
echo This page explains the function of each of the 5 key presses on start.
echo.
echo (Clone Loadout Files[c])
echo This function takes the current cache in the cache file and uploads it into a new folder 
echo name allowing for another loadout bar customization.
echo.
echo.
echo (Start Game[s])
echo This function allows you to start the game with either a new (deletes the current cache in 
echo the game generating a new one) and starts as that. Or you can select one of the previously
echo made folders from the clone functione allowing you a custom loadout bar.
echo.
echo.
echo (Change Cache File[f])
echo This changes the cache file, yours currently "%cachePath%", to whatever
echo you may want it to be if it's missplaced.
echo.
echo.
echo (Exit[e])
echo Exits the client starter.
echo.
echo.
echo (Help[h])
echo Brings up this menu
echo meta as fuck by the way.
echo.
pause
:rootFile
cls
echo Cache folder path will look something like "C:\Users\username\.spawnpk-data"
set /p cachePath=What is your cache folder path: 
>"cachePath.txt" echo %cachePath%
goto startofFile

:retryStart
cls
echo That loadout file does not exist.
echo.
goto skipClear2
:startGame
cls
:skipClear2
echo Warning, if you do not have a last used file the current loadout saved in cache will be deleted.
set /p usingLoadout=What loadout file would you like to use on game launch? (new^|Named Loadout^) 
if "%usingLoadout%" == "new" (
	copy "%cachePath%\loadout.conf" "SpawnPKLoadouts\%lastUsed%\loadout.conf"
	del "%cachePath%\loadout.conf"
	goto spkStart
)
echo SpawnPKLoadouts\%usingLoadout%\loadout.conf
echo %cachePath%\loadout.conf
copy "SpawnPKLoadouts\%usingLoadout%\loadout.conf" "%cachePath%"
if errorlevel 1 (
	goto retryStart
)
>"lastUsed.txt" echo %usingLoadout%
goto skipClear3
:spkStart
del "%cachePath%\loadout.conf"
del lastUsed.txt
:skipClear3
start SPK.jar
exit
:cloneLoadouts
set /p nameOfNewFile=What would you like the name of the new loadout file to be called? 
md SpawnPKLoadouts\%nameOfNewFile%
copy "%cachePath%\loadout.conf" "SpawnPKLoadouts\%nameOfNewFile%
goto startOfFile

 

Spoiler


@echo off
setlocal EnableDelayedExpansion
if exist lastUsed.txt (
    set /p lastUsed=<"lastUsed.txt"
)
if not exist cachePath.txt (
    if exist C:\Users\%username%\.spawnpk-data (
        echo C:\Users\%username%\.spawnpk-data > "cachePath.txt"
        set cachePath=C:\Users\%username%\.spawnpk-data
    )
)
if not exist SpawnPKLoadouts (
    md "SpawnPKLoadouts"
)
if not exist cachePath.txt (
    cls
    echo Cache folder was not automatically found.
    echo.
    echo Cache folder path will look something like "C:\Users\%username%\.spawnpk-data"
    set /p cachePath=What is your cache folder path? 
    echo %cachePath% > "cachePath.txt"
)
set /p cachePath=<"cachePath.txt"
set /p saveLastUsed=Do you want for your last used client to be saved over %lastUsed%?(y^|n^) 
if "%saveLastUsed%" == "y" (
copy "%cachePath%\loadout.conf" "SpawnPKLoadouts\%lastUsed%\loadout.conf"
)
:startOfFileFail
cls
echo Please enter a proper input.
goto skipClear
:startOfFile
cls
:skipClear
echo Current folder path:
echo Cache: "%cachePath%"
set /p whatDo=What would you like to do? (Clone Loadout Files[c]) (Start Game[s] (Change Cache File[f]) (Exit[e]) 
if "%whatDo%" == "c" (
    goto cloneLoadouts
)
if "%whatDo%" == "f" (
    goto RootFile
)
if "%whatDo%" == "s" (
    goto startGame
)
if "%whatDo%" == "e" (
    exit
)
goto startOfFileFail

:rootFile
cls
echo Cache folder path will look something like "C:\Users\username\.spawnpk-data"
set /p cachePath=What is your cache folder path: 
>"cachePath.txt" echo %cachePath%
goto startofFile

:retryStart
cls
echo That loadout file does not exist.
echo.
goto skipClear2
:startGame
cls
:skipClear2
echo Warning, if you do not have a last used file the current loadout saved in cache will be deleted.
set /p usingLoadout=What loadout file would you like to use on game launch? (new^|Named Loadout^) 
if "%usingLoadout%" == "new" (
    copy "%cachePath%\loadout.conf" "SpawnPKLoadouts\%lastUsed%\loadout.conf"
    del "%cachePath%\loadout.conf"
    goto spkStart
)
echo SpawnPKLoadouts\%usingLoadout%\loadout.conf
echo %cachePath%\loadout.conf
copy "SpawnPKLoadouts\%usingLoadout%\loadout.conf" "%cachePath%"
if errorlevel 1 (
    goto retryStart
)
>"lastUsed.txt" echo %usingLoadout%
goto skipClear3
:spkStart
del "%cachePath%\loadout.conf"
del lastUsed.txt
:skipClear3
start SPK.jar
exit
:cloneLoadouts
set /p nameOfNewFile=What would you like the name of the new loadout file to be called? 
md SpawnPKLoadouts\%nameOfNewFile%
copy "%cachePath%\loadout.conf" "SpawnPKLoadouts\%nameOfNewFile%
goto startOfFile

 

 

 

Edited by Killbrid
v1.2 fixes a bug with automatic cache detection

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×