Batch file 当时的意外回音

Batch file 当时的意外回音,batch-file,time,echo,Batch File,Time,Echo,因此,我正在为我的朋友制作一个简单的批处理游戏,当它到达这一部分时,它告诉我Echo命令此时意外关闭,我无法找出它的错误,请帮助 :WTS5 set /p chainboots=<"character\inventory\armor\chain\chainboots.txt" set /p chaingloves=<"character\inventory\armor\chain\chaingloves.txt" set /p chainhelm=<"character\inv

因此,我正在为我的朋友制作一个简单的批处理游戏,当它到达这一部分时,它告诉我Echo命令此时意外关闭,我无法找出它的错误,请帮助

:WTS5
set /p chainboots=<"character\inventory\armor\chain\chainboots.txt"
set /p chaingloves=<"character\inventory\armor\chain\chaingloves.txt"
set /p chainhelm=<"character\inventory\armor\chain\chainhelm.txt"
set /p chainlegging=<"character\inventory\armor\chain\chainleggings.txt"
set /p chaintorso=<"character\inventory\armor\chain\chaintorso.txt"
set /p woodensword=<character\inventory\woodensword.txt
set /p Echainboots=<"character/equiped/armor/chain/chainboots.txt
set /p Echainlegging=<"character/equiped/armor/chain/chainleggings.txt
set /p Echaintorso=<"character/equiped/armor/chain/chaintorso.txt
set /p Echainhelm=<"character/equiped/armor/chain/chainhelm.txt
set /p Echaingloves=<"character/equiped/armor/chain/chaingloves.txt
set /p Ewoodensword=<"character/equiped/hands/woodensword.txt
set /p Ewoodensheild=<"character/equiped/hands/woodenshield.txt
cls
echo.
echo.
echo.
echo Current armor intems in inventory include:
echo %true% >"character/inventory/woodensheild.txt"
set /p woodensheild= <"character\inventory\woodensheild.txt"
if %chainboots%==%true% echo 575 Chain boots
if %chainleggins%==%true% echo 680 Chain leggings  
if %chaintorso%==%true%  echo 902 chain torso
if %chaingloved%==%true%   echo 588 Chain gloves
If %chainhelm%==%true% echo 795 Chain helm
echo.
echo.
echo Current weapons and shelds in inventory include:
If %woodensheild%==%true% echo 841 wooden shield
IF %woodensword%==%true%  echo 426 wooden sword

echo.
echo.
echo Current items in inventory include:
echo.
echo.
echo Type 1 to continue otherwise type item id to equip
echo.
set /p a="Enter Item ID:"
If %a%=575 (
 echo %false% > %chainboots%
 echo %true% > %Echainboots%
 goto WTS5 
) Else IF %a%==680 (
 echo %false% > %chainleggings%
 echo %true% > %Echainleggings%
 goto WTS5
) Else if %a%==902 (
 echo %false% > %chaintorso%
 echo %true% > %Echaintorso%
 goto WTS5
) Else if %a%==588 (
 echo %false% > %changloves%
 echo %true% > %Echaingloves%
 goto WTS5
) Else if %a%==795 (
 echo %false% > %chainhelm%
 echo %true% > %Ehainhelm%
 goto WTS5
) Else if %a%==841 (
 echo %false% > %woodenshield%
 echo %true% > %Ewoodenshield%
 goto WTS5
) Else if %a%==426 (
 echo %false% > %woodensword%
 echo %true% > %Ewoodensword%
 goto WTS5
) Else IF %a%==1 (
 goto WTS6
) Else (
 cls
 echo invalid ID
 pause
 goto WTS5
)
:WTS5

set/p chainboots=如果
的比较结果用双引号引起来,则将您的
放在双引号中:

If "%woodensheild%"=="%true%" echo 841 wooden shield
IF "%woodensword%"=="%true%"  echo 426 wooden sword

好吧,在连续两个多小时盯着代码看之后,我发现了我的问题

 set /p chainlegging=<"character\inventory\armor\chain\chainleggings.txt"

set/p chainlegging=你知道是哪个
echo
引起的吗?
%true%
的值是多少?@David我不知道witch echo引起的,所以true被设置为与游戏中早些时候设置的相同。我在你推荐后尝试了这个。它不再以错误结束,而是在输出中显示我的值,我得到的是“”=“true”echo 841 Woodshield。它也不响应我告诉它的内容