Choose Your Own Adventure ゲームをバッチで作成していますが、ゲームでのあなたの行動を追跡するために、その中に統計を入れたいと思っています。統計を表示したいのですが、コマンドがあるたびに表示する必要がclsあり、そのコマンドを頻繁に使用する:Statsため、必要なときにいつでも呼び出すことができるように、というブロックを作成しました。正常に動作しますが、Stats 表示後のナラティブが機能していないようです。ブロックを維持したい:colorEchoので、プレイヤーは会話、物語、選択肢を入力するコマンドを区別できます。これを修正する方法についてのアイデアはありますか?
:Start
::Game goes here.
cls
Echo Please enter your player name.
set /p PlayerName="Player name: "
cls
call :Stats
call :colorEcho 7 "You lay on the cold, hard ground, sleeping away. It's been 1 month since the Virus spread..."
Echo.
call :colorEcho 7 "The sun rises over the horizon, warming up your dirt-caked body."
Echo .
pause
exit
:Stats
call :colorEcho A "Current Health = "
call :colorEcho C " %Health%"
Echo.
call :colorEcho A "Hunger = "
call :colorEcho C " %Food%"
Echo.
call :colorEcho A "Thirst = "
call :colorEcho C " %Water%"
Echo.
call :colorEcho A "Infection = "
call :colorEcho C " %Infection%"
Echo.
call :colorEcho A "Stamina = "
call :colorEcho C " %Stamina%"
Echo.
Echo.
pause
:colorEcho
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1i
補足: すべての変数を定義しました。確信したこと。
起こるはずのこと:
実際に何が起こるか:

