I wasn't sure where to put this, so I'll place this here.
This is a short little batch script that allows you to swap out .tsk files.
Reason?
Well I run multiple hearthstone accounts/bot accounts, and I was previously having a "hearthranger" folder for each one. Then I realized everything else is shared between then except for the "HearthRanger - Bot for Hearthstone.tsk" (as far as I'm aware). So to reduce space being used on my computer, I thought why don't I just switch the tsk files. But instead of bogging JoyAdmin with more feature requests, I decided to write up a script.
Usage:
You can either run this script inside the root Hearthranger folder or within the task folder itself.
Running it inside the main folder gives you the option to run Hearthranger.exe
Since I can't include attachments, I'll just post the code snippet below. Just create a "switchtask.bat" file, paste the provided code in and run it.
Code:
@echo off
set target=HearthRanger - Bot for Hearthstone.tsk
ECHO switches .tsk files for HearthRanger
ECHO existing `.tsk` files:
rem set task=false
if exist "task" (
set target_path=task\
dir /b /d /a-d task\*.tsk
) else (
set target_path=
dir /b /d /a-d *.tsk
)
ECHO ** enter names ~without~ ".tsk" ending **
set /p input=Enter filename of config to use:
set /p output=Enter filename to save current as:
ECHO Moving "%target_path%%target%" to "%target_path%%output%.tsk"
move "%target_path%%target%" "%target_path%%output%.tsk"
ECHO Moving "%target_path%%input%.tsk" to "%target_path%%target%"
move "%target_path%%input%.tsk" "%target_path%%target%"
if "%target_path%"=="task\" (
goto launch
) else (
pause
goto cont
)
:launch
set /p hearthranger=Would you like to launch HearthRanger? (y/n):
if "%hearthranger%"=="y" (
if exist "HearthRanger.exe" (
ECHO Launching HearthRanger.exe
start "" "HearthRanger.exe"
) else (
ECHO HearthRanger.exe not in current directory
)
)
:cont
Old Code:
Code:
@echo off
set target=HearthRanger - Bot for Hearthstone.tsk
set task=false
if exist "task" (
set target_path=task\
) else (
set target_path=
)
ECHO Switches .tsk files for HearthRanger
ECHO ** enter names ~without~ ".tsk" ending **
set /p input=Enter filename of config to use:
set /p output=Enter filename to save current as:
ECHO Moving "%target_path%%target%" to "%target_path%%output%.tsk"
move "%target_path%%target%" "%target_path%%output%.tsk"
ECHO Moving "%target_path%%input%.tsk" to "%target_path%%target%"
move "%target_path%%input%.tsk" "%target_path%%target%"
if "%target_path%"=="task\" (
goto launch
) else (
pause
goto cont
)
:launch
set /p hearthranger=Would you like to launch HearthRanger? (y/n):
if "%hearthranger%"=="y" (
if exist "HearthRanger.exe" (
ECHO Launching HearthRanger.exe
start "" "HearthRanger.exe"
) else (
ECHO HearthRanger.exe not in current directory
)
)
:cont