这是一个很好的做法,是不会有你的变量以数字开头,为%1
手段传递到脚本的第一个参数。如果您没有将任何参数传递给脚本,解释器将看到这些语句为if not st%==1 goto 1st
和if st%==1 %atk%+25
,这些语句无效。
您需要替换所有%1st%
与提议%first%
,其余如下:
%2nd%
到%second%
%3rd%
到%third%
%4th%
到%fourth%
%5th%
到%fifth%
%6th%
到%sixth%
%7th%
到%seventh%
%8th%
到%eighth%
%9th%
到%ninth%
这里是你与上述变化代码:
if %first%==1 %atk%+25
if %first%==2 %def%+25
if %first%==3 %hp%+25
if %first%==4 %iq%+25
if %first%==5 %luck%+25
if not %first%==1 goto first
if not %first%==2 goto first
if not %first%==3 goto first
if not %first%==4 goto first
if not %first%==5 goto first
而且我不知道你是如何添加值,这里是一个修改建议用set /a
命令:
if %first%==1 set /a atk=%atk%+25
if %first%==2 set /a def=%def%+25
if %first%==3 set /a hp=%hp%+25
if %first%==4 set /a iq=%iq%+25
if %first%==5 set /a luck=%luck%+25
if not %first%==1 goto first
if not %first%==2 goto first
if not %first%==3 goto first
if not %first%==4 goto first
if not %first%==5 goto first
OK。什么是或不在工作? – ClickRick
它使程序崩溃而不是回到最后一个标记。 – Woops