2016-08-01 95 views
0

所以我创建有很多变量的比赛,但我希望用户既可以限制进入和/或到了一定地点或面积取决于设置的变量。
调用批处理和检查值:批处理文件总是崩溃,但脚本似乎还好

我有,你可以去写上去的所有地方,但出于某种原因,似乎是我无法识别某些语法错误。下面是一个例子,但是我在整个游戏中有很多细微的变化,这取决于你已经杀死了什么实体或者你在哪里设置了你的家乡。

我得到一个错误信息,但该程序关闭的方式太快了,我看它说什么。我试图录制“崩溃”,并放慢了视频速度,但图像质量并不是最好的。 “spawn0不被识别”的东西,我假设它与语法有关。

有几个变量检查​​器可以工作,比如在允许你进入城堡之前检查你的角色等级(见下面)。

set /p cit1= 
if %cit1% EQU 1 GOTO citadellvlcheck 
if %cit1% EQU 2 GOTO SAVE_GAME_FILES_Masafkel 
GOTO CIT_WARN 

:citadellvlcheck 
if %curlvl% LSS 50 GOTO citadellvlreq 
if %curlvl% GEQ 50 GOTO entercitadel 

:citadellvlreq 
@echo off 
color 0F 
cls 
echo. 
echo You must be level 50 or higher to enter the citadel. 
pause > nul 
GOTO MasafkelMenu-XC 


但因为我不能产卵检查工作,或MasafkelMenu-XC作为一个用户登录到游戏中工作,尽快,它瞬间崩溃。创建用户也是如此。你设置你的用户名,密码,游戏内电子邮件(以防万一你忘记了密码),性别甚至物种;但之后立即崩溃,甚至没有创建字符批处理文件。以下是一些例子。

:SpawnCheck 
@echo off 
Title Adrynia 
Color 0F 
cls 
call %name1%.bat 
if %spawn%=spawn0 GOTO SpawnMenu0 
if %spawn%=spawn1 GOTO SpawnMenu0 
if %spawn%=spawn2 GOTO SpawnMenu0 
if %spawn%=spawn3 GOTO SpawnMenu0 
if %spawn%=spawn4 GOTO SpawnMenu0 
if %spawn%=spawn5 GOTO SpawnMenu0 
if %spawn%=spawn6 GOTO SpawnMenu0 
if %spawn%=spawn7 GOTO SpawnMenu0 
if %spawn%=spawn8 GOTO SpawnMenu0 
if %spawn%=spawn9 GOTO SpawnMenu0 
if %spawn%=Groylle GOTO GroylleMenu 
if %spawn%=Meprophia GOTO MeprophiaMenu 
if %spawn%=HermitHut GOTO HermitHutMenu 
if %spawn%=Masafkel GOTO MasafkelMenu-XC 
if %spawn%=Crounver GOTO CrounverMenu 
if %spawn%=Bobeindahl GOTO BobeindahlMenu 
if %spawn%=Krontay GOTO KrontayMenu 
if %spawn%=Slinguss GOTO SlingussMenu 
if %spawn%=Tichyster GOTO TichysterMenu 
if %spawn%=Houjing GOTO HoujingMenu 
if %spawn%=flat1 GOTO FlatMenu1 
if %spawn%=flat2 GOTO FlatMenu2 
if %spawn%=flat3 GOTO FlatMenu3 
if %spawn%=flat4 GOTO FlatMenu4 
if %spawn%=flat5 GOTO FlatMenu5 
if %spawn%=flat6 GOTO FlatMenu6 
if %spawn%=flat7 GOTO FlatMenu7 
if %spawn%=flat8 GOTO FlatMenu8 
if %spawn%=flat9 GOTO FlatMenu9 
if %spawn%=flat10 GOTO FlatMenu10 
if %spawn%=house1 GOTO HouseMenu1 
if %spawn%=house2 GOTO HouseMenu2 
if %spawn%=house3 GOTO HouseMenu3 
if %spawn%=house4 GOTO HouseMenu4 
if %spawn%=house5 GOTO HouseMenu5 
if %spawn%=house6 GOTO HouseMenu6 
if %spawn%=house7 GOTO HouseMenu7 
if %spawn%=house8 GOTO HouseMenu8 
if %spawn%=house9 GOTO HouseMenu9 
if %spawn%=house10 GOTO HouseMenu10 
GOTO Error 


:MasafkelMenu-XC 
@echo off 
color 0f 
cls 
call %name1%.bat 
if %Criunthma%=0 GOTO MasafkelMenu 
if %Criunthma%=1 GOTO Masafkel-CD 
GOTO Error 


如果无法做到在批处理文件中这样的事那就这样吧,但是如果有可能,我想至少给我最好的尝试。

所以,比游戏是一个基于文本的游戏以外,玩家使用他/她的想象力,以创造游戏世界的美好感觉在他们身边,因此希望提升游戏体验;我也喜欢用这个游戏来学习新技能的编码和测试批处理脚本和我的小,但批量MS-DOS和批处理脚本的逐渐增加知识的局限性。

现在,当我在cmd中运行一些测试时,显示如下:“Artemis.bat”不被识别为内部或外部命令,可操作程序或批处理文件。 = spawn0在这个时候是意外的。无论您选择用户名是什么,这都出现了,但是,当它自己运行时,它仅表示“= spawn0此时不是预期的”。

我不明白%spawnpoint%= spawn0无法被识别,或者可能是意想不到的,因为字符在创建时得到了一个指定的后备点(在:CHAR_DATA)当你第一次创建一个字符时:CHAR_DATA指定您产卵名为“spawnpoint;但如果你设置了家乡,或买一个房子或者一个单位,那么你的重生将被设置为城镇或房子/平代替,所以,当你开始游戏,你将开始在

:CHAR_DATA 
set acc1g=0 
set acc1m=Open 
set acc2g=0 
set acc2m=Open 
set acc3g=0 
set acc3m=Open 
set acc4g=0 
set acc4m=Open 
set acc5g=0 
set acc5m=Open 
set cost= 
set cost1= 
set gcho= 
set echo= 
set e2cho= 
set e1= 
set armour=30 
set origarmour=30 
set Cyrax=0 
set Fregwin=0 
set Zeschka=0 
set Agnorr=0 
set Grehln=0 
set Meiqa=0 
set Lothin=0 
set Skatha=0 
set Triffyn=0 
set Glieza=0 
set Areya=0 
set Exin=0 
set Yewvar=0 
set Smuggler=0 
set Qwaen=0 
set Oracle=0 
set Antharr=0 
set Cadell=0 
set Rhyghan=0 
set Helori=0 
set Chaerron=0 
set Cyntheyrr=0 
set Mureh=0 
set Llaellyn=0 
set Bechim=0 
set Brathach=0 
set Albreqi=0 
set Tausir=0 
set Mivrailoksh=0 
set Khaen=0 
set Criunthma=0 
set Vunada=0 
set VT=0 
set VC=G 
set ls1=0 
set killcount=0 
set ttlbosskill=0 
set ttlmonstkill=0 
set ttlkills=0 
set goodness=0 
set evilness=0 
set morality=neutral 
set ls2=0 
set la1=0 
set la2=0 
set orighp=100 
set hp=100 
set origsp=25 
set sp=25 
set armtype=None 
set swordtype=Your 
set skind=hand 
set buyword1=hi 
set buyword2=hi 
set curlvl=1 
set aan=a 
set bankqharri=0 
set destination=SAVE_GAME_FILES1 
set destination2=SAVE_GAME_FILES1 
set swordchoice=Nothing 
set swordchoice2=Nothing 
set swordchoice3=Nothing 
set swordexist=Nothing 
set rent=0 
set sprice=0 
set armchoice=No 
set armchoice2=Amour 
set aprice=0 
set playerxp=0 
set xpuntil=1000 
set origxp=0 
set money=0 
set platos=0 
set lovana=0 
set credits=0 
set key=0 
set dmge=10 
set origdmge=10 
set dr=0 
set spawn=spawn0 
set rests=0 
set sleep=100 
set rochtain=0 
set beer=0 
set wine=0 
set spirits=0 
set naeprahv=0 
set drunk=0 
set ID=0 
set day=42 
set week=5 
set month=12 
set year=73734 
set status=alive 
set gmail=0 
set hbone=0 
set dhide=0 
set rtab=0 
set food=0 
set cigarette=0 
set seaweed=0 
set weedcig=0 
set rfood=0 
set bait=0 
set ea=None 
set potion=0 
set copperingot=0 
set ironingot=0 
set steelingot=0 
set bronzeingot=0 
set brassingot=0 
set tiningot=0 
set silveringot=0 
set goldingot=0 
set zincingot=0 
set manganeseingot=0 
set aluminiumingot=0 
set chromiumingot=0 
set nickelingot=0 
set refinedcopper=0 
set refinediron=0 
set refinedtin=0 
set refinedsilver=0 
set refinedgold=0 
set refinedzinc=0 
set refinedmanganese=0 
set refinedaluminium=0 
set refinedsilicon=0 
set refinedchromium=0 
set refinednickel=0 
set seed=0 
set bow=0 
set fur=0 
set gem=0 
set log=0 
set wood=0 
set copperore=0 
set ironore=0 
set tinore=0 
set silverore=0 
set goldore=0 
set zincore=0 
set manganeseore=0 
set aluminiumore=0 
set siliconore=0 
set chromiumore=0 
set nickelore=0 
set morb=0 
set arm1=0 
set arm2=0 
set arm3=0 
set arm4=0 
set arm5=0 
set arm6=0 
set arm7=0 
set arm8=0 
set arm9=0 
set arm10=0 
set arm11=0 
set arm12=0 
set ma1=0 
set ma2=0 
set ma3=0 
set ma4=0 
set ma5=0 
set ma6=0 
set ma7=0 
set ma8=0 
set ma9=0 
set ma10=0 
set ms1=0 
set ms2=0 
set ms3=0 
set ms4=0 
set ms5=0 
set ms6=0 
set ms7=0 
set ms8=0 
set ms9=0 
set ms10=0 
set sword1=0 
set sword2=0 
set sword3=0 
set sword4=0 
set sword5=0 
set sword6=0 
set sword7=0 
set sword8=0 
set sword9=0 
set sword10=0 
set sword11=0 
set sword12=0 
set axxx=0 
set pgmail=300 
set phbone=550 
set pdhide=750 
set prtab=250 
set ppotion=200 
set pfood=100 
set pingot=473 
set pseed=150 
set prfood=100 
set pbait=2 
set pfur=200 
set pore=500 
set plog=275 
set pgem=500 
set pbow=713 
set pmorb=15000 
set Woodcuttinglvl=1 
set Woodcuttingxpremain=5000 
set Woodcuttingxpgain=20 
set Woodcuttingcurxp=0 
set Woodcuttingxpleft=5000 
set Cooklvl=1 
set Cookxpremain=5000 
set Cookxpgain=50 
set Cookcurxp=0 
set Cookxpleft=5000 
set Fishinglvl=1 
set Fishingxpremain=5000 
set Fishingxpgain=50 
set Fishingcurxp=0 
set Fishingxpleft=5000 
set Mininglvl=1 
set Miningxpremain=5000 
set Miningxpgain=50 
set Miningcurxp=0 
set Miningxpleft=100 
set Smeltinglvl=1 
set Smeltingxpremain=5000 
set Smeltingxpgain=50 
set Smeltingcurxp=0 
set Smeltingxpleft=5000 
set Thievinglvl=1 
set Thievingxpremain=10000 
set Thievingxpgain=25 
set Thievingcurxp=0 
set Thievingxpleft=10000 
set ttllvl=13 
set prestige=0 
set maxprestige=NO 
GOTO SpawnCheck 


您的产卵。以上是用于设置字符日志文件,下面的代码是用来保存当前正在使用的字符日志文件中的当前变量。

:SAVE_GAME_FILES1 
(
echo set username1=%username1% 
echo set password1=%password1% 
echo set mailver=%mailver% 
echo set species=%species% 
:CHAR_DATA 
echo set acc1g=%acc1g% 
echo set acc1m=%acc1m% 
echo set acc2g=%acc2g% 
echo set acc2m=%acc2m% 
echo set acc3g=%acc3g% 
echo set acc3m=%acc3m% 
echo set acc4g=%acc4g% 
echo set acc4m=%acc4m% 
echo set acc5g=%acc5g% 
echo set acc5m=%acc5m% 
echo set cost1=%cost1% 
echo set cost=%cost% 
echo set gcho=%gcho% 
echo set echo=%echo% 
echo set e2cho=%e2cho% 
echo set e1=%e1% 
echo set armour=%armour% 
echo set origarmour=%origarmour% 
echo set Cyrax=%Cyrax% 
echo set Fregwin=%Fregwin% 
echo set Zeschka=%Zeschka% 
echo set Agnorr=%Agnorr% 
echo set Grehln=%Grehln% 
echo set Meiqa=%Meiqa% 
echo set Lothin=%Lothin% 
echo set Skatha=%Skatha% 
echo set Triffyn=%Triffyn% 
echo set Glieza=%Glieza% 
echo set Areya=%Areya% 
echo set Exin=%Exin% 
echo set Yewvar=%Yewvar% 
echo set Smuggler=%Smuggler% 
echo set Qwaen=%Qwaen% 
echo set Oracle=%Oracle% 
echo set Antharr=%Antharr% 
echo set Cadell=%Cadell% 
echo set Rhyghan=%Rhyghan% 
echo set Helori=%Helori% 
echo set Chaerron=%Chaerron% 
echo set Cyntheyrr=%Cyntheyrr% 
echo set Mureh=%Mureh% 
echo set Llaellyn=%Llaellyn% 
echo set Bechim=%Bechim% 
echo set Brathach=%Brathach% 
echo set Albreqi=%Albreqi% 
echo set Tausir=%Tausir% 
echo set Mivrailoksh=%Mivrailoksh% 
echo set Khaen=%Khaen% 
echo set Criunthma=%Criunthma% 
echo set Vunada=%Vunada% 
echo set VT=%VT% 
echo set VC=%VC% 
echo set ls1=%ls1% 
echo set killcount=%killcount% 
echo set ttlbosskill=%ttlbosskill% 
echo set ttlmonstkill=%ttlmonstkill% 
echo set ttlkills=%ttlkills% 
echo set goodness=%goodness% 
echo set evilness=%evilness% 
echo set morality=%morality% 
echo set ls2=%ls2% 
echo set la1=%la1% 
echo set la2=%la2% 
echo set orighp=%orighp% 
echo set hp=%hp% 
echo set origsp=%origsp% 
echo set sp=%sp% 
echo set armtype=%armtype% 
echo set swordtype=%swordtype% 
echo set skind=%skind% 
echo set buyword1=%buyword1% 
echo set buyword2=%buyword2% 
echo set curlvl=%curlvl% 
echo set aan=%aan% 
echo set bankqharri=%bankqharri% 
echo set destination=SAVE_GAME_FILES1 
echo set destination2=SAVE_GAME_FILES1 
echo set swordchoice=Nothing 
echo set swordchoice2=Nothing 
echo set swordchoice3=Nothing 
echo set swordexist=Nothing 
echo set rent=%rent% 
echo set sprice=%sprice% 
echo set armchoice=%armchoice% 
echo set armchoice2=%armchoice2% 
echo set aprice=%aprice% 
echo set playerxp=0 
echo set xpuntil=1000 
echo set origxp=%origxp% 
echo set money=%money% 
echo set platos=%platos% 
echo set lovana=%lovana% 
echo set ruflarii=%ruflarii% 
echo set credits=%credits% 
echo set key=%key% 
echo set dmge=%dmge% 
echo set origdmge=%origdmge% 
echo set dr=%dr% 
echo set spawn=%spawn% 
echo set rests=%rests% 
echo set sleep=%sleep% 
echo set rochtain=%rochtain% 
echo set beer=%beer% 
echo set wine=%wine% 
echo set spirits=%spirits% 
echo set naeprahv=%naeprahv% 
echo set drunk=%drunk% 
echo set ID=%ID% 
echo set day=%week% 
echo set week=%week% 
echo set month=%month% 
echo set year=%year% 
echo set status=%status% 
echo set gmail=%gmail% 
echo set hbone=%hbone% 
echo set dhide=%dhide% 
echo set rtab=%rtab% 
echo set food=%food% 
echo set cigarette=%cigarette% 
echo set seaweed=%seaweed% 
echo set weedcig=%weedcig% 
echo set rfood=%rfood% 
echo set bait=%bait% 
echo set ea=%ea% 
echo set potion=%potion% 
echo set copperingot=%copperingot% 
echo set ironingot=%ironingot% 
echo set steelingot=%steelingot% 
echo set bronzeingot=%bronzeingot% 
echo set brassingot=%brassingot% 
echo set tiningot=%tiningot% 
echo set silveringot=%silveringot% 
echo set goldingot=%goldingot% 
echo set zincingot=%zincingot% 
echo set manganeseingot=%manganeseingot% 
echo set aluminiumingot=%aluminiumingot% 
echo set chromiumingot=%chromiumingot% 
echo set nickelingot=%nickelingot% 
echo set refinedcopper=%refinedcopper% 
echo set refinediron=%refinediron% 
echo set refinedtin=%refinedtin% 
echo set refinedsilver=%refinedsilver% 
echo set refinedgold=%refinedgold% 
echo set refinedzinc=%refinedzinc% 
echo set refinedmanganese=%refinedmanganese% 
echo set refinedaluminium=%refinedaluminium% 
echo set refinedsilicon=%refinedsilicon% 
echo set refinedchromium=%refinedchromium% 
echo set refinednickel=%refinednickel% 
echo set seed=%seed% 
echo set bow=%bow% 
echo set fur=%fur% 
echo set gem=%gem% 
echo set log=%log% 
echo set wood=%wood% 
echo set copperore=%copperore% 
echo set ironore=%ironore% 
echo set tinore=%tinore% 
echo set silverore=%silverore% 
echo set goldore=%goldore% 
echo set zincore=%zincore% 
echo set manganeseore=%manganeseore% 
echo set aluminiumore=%aluminiumore% 
echo set siliconore=%siliconore% 
echo set chromiumore=%chromiumore% 
echo set nickelore=%nickelore% 
echo set morb=%morb% 
echo set arm1=%arm1% 
echo set arm2=%arm2% 
echo set arm3=%arm3% 
echo set arm4=%arm4% 
echo set arm5=%arm5% 
echo set arm6=%arm6% 
echo set arm7=%arm7% 
echo set arm8=%arm8% 
echo set arm9=%arm9% 
echo set arm10=%arm10% 
echo set arm11=%arm11% 
echo set arm12=%arm12% 
echo set ma1=%ma1% 
echo set ma2=%ma2% 
echo set ma3=%ma3% 
echo set ma4=%ma4% 
echo set ma5=%ma5% 
echo set ma6=%ma6% 
echo set ma7=%ma7% 
echo set ma8=%ma8% 
echo set ma9=%ma9% 
echo set ma10=%ma10% 
echo set ms1=%ms1% 
echo set ms2=%ms2% 
echo set ms3=%ms3% 
echo set ms4=%ms4% 
echo set ms5=%ms5% 
echo set ms6=%ms6% 
echo set ms7=%ms7% 
echo set ms8=%ms8% 
echo set ms9=%ms9% 
echo set ms10=%ms10% 
echo set sword1=%sword1% 
echo set sword2=%sword2% 
echo set sword3=%sword3% 
echo set sword4=%sword4% 
echo set sword5=%sword5% 
echo set sword6=%sword6% 
echo set sword7=%sword7% 
echo set sword8=%sword8% 
echo set sword9=%sword9% 
echo set sword10=%sword10% 
echo set sword11=%sword11% 
echo set sword12=%sword12% 
echo set axxx=%axxx% 
echo set pgmail=%pgmail% 
echo set phbone=%phbone% 
echo set pdhide=%pdhide% 
echo set prtab=%prtab% 
echo set ppotion=%ppotion% 
echo set pingot=%pingot% 
echo set pfood=%pfood% 
echo set prfood=%prfood% 
echo set pbait=%pbait% 
echo set pseed=%pseed% 
echo set pfur=%pfur% 
echo set pore=%pore% 
echo set pbow=%pbow% 
echo set plog=%plog% 
echo set pgem=%pgem% 
echo set pmorb=%pmorb% 
echo set Woodcuttinglvl=%Woodcuttinglvl% 
echo set Woodcuttingxpremain=%Woodcuttingxpremain% 
echo set Woodcuttingxpgain=%Woodcuttingxpgain% 
echo set Woodcuttingcurxp=%Woodcuttingcurxp% 
echo set Woodcuttingxpleft=%woodcuttingxpleft% 
echo set Cooklvl=%Cooklvl% 
echo set Cookxpremain=%Cookxpremain% 
echo set Cookxpgain=%Cookxpgain% 
echo set Cookcurxp=%Cookcurxp% 
echo set Cookxpleft=%Cookxpleft% 
echo set Fishinglvl=%Fishinglvl% 
echo set Fishingxpremain=%Fishingxpremain% 
echo set Fishingxpgain=%Fishingxpgain% 
echo set Fishingcurxp=%Fishingcurxp% 
echo set Fishingxpleft=%Fishingxpleft% 
echo set Mininglvl=%Mininglvl% 
echo set Miningxpremain=%Miningxpremain% 
echo set Miningxpgain=%Miningxpgain% 
echo set Miningcurxp=%Miningcurxp% 
echo set Miningxpleft=%Miningxpleft% 
echo set Smeltinglvl=%Smeltinglvl% 
echo set Smeltingxpremain=%Smeltingxpremain% 
echo set Smeltingxpgain=%Smeltingxpgain% 
echo set Smeltingcurxp=%Smeltingcurxp% 
echo set Smeltingxpleft=%Smeltingxpleft% 
echo set Thievinglvl=%Thievinglvl% 
echo set Thievingxpremain=%Thievingxpremain% 
echo set Thievingxpgain=%Thievingxpgain% 
echo set Thievingcurxp=%Thievingcurxp% 
echo set Thievingxpleft=%Thievingxpleft% 
echo set ttllvl=%ttllvl% 
echo set prestige=%prest% 
echo set maxprestige=%maxprest% 
)>%username1%.bat 
GOTO SpawnCheck 


在节中的记录似乎是罚款,但为了以防万一,下面是该代码。

:login 
cls 
set /p name1="Username: " 
if not exist "%name1%.bat" (
echo. 
echo That is not a valid Username. 
timeout /T 3 > nul 
GOTO entergame1 
) 
set /p pass1="Password: " 
call %name1%.bat 
if %password1% NEQ %pass1% (
echo. 
echo That is not a valid Password, please enter your in-game email. 
timeout /T 3 > nul 
GOTO emailver 
) 
GOTO SAVE_GAME_FILES1 

:emailver 
cls 
echo. 
set /p mailver="In-game Email: " 
call %name1%.bat 
if %mailver% NEQ %mailver% (
echo. 
echo That is not a valid in-game email address. 
timeout /T 3 > nul 
cls 
GOTO entergame1 
) 
GOTO SAVE_GAME_FILES1 


字符生成器部分也似乎是功能性的,但只要它进入:SpawnCheck崩溃。

:createuser 
@echo off 
Title Adrynia 
color 0F 
cls 
echo. 
echo What would you like your Username to be? 
set /p username1= 
set v1f=0 

:checkforspaces 
set x=!v1f! 
set Letter%v1f%=!username1:~%x%,1! 
if "!Letter%v1f%!" EQU " " (
echo. 
echo. 
echo Sorry, you cant use spaces in your Username. 
pause > nul 
GOTO createuser 
) 
if NOT "!Letter%v1f%!" EQU "" (
set /a v1f=%v1f%+1 
GOTO checkforspaces 
) 
echo. 
echo What would you like your Password to be? 
set /p password1= 
echo. 
echo What would you like your in-game email to be? (This will be used as secondary login/verification option). 
set /a rpc=1 
set /p mailver= 
GOTO choosespecies2 


:choosespecies2 
@echo off 
Title Adrynia 
color 0F 
cls 
echo. 
echo What species would you like to be? 
echo. 
echo 1) Adrynian 
echo 2) Bryniskan 
echo 3) Cruvoshnian 
echo 4) Gangloidian 
echo 5) Human 
echo 6) Hybrid 
echo 7) Sehyapov 
echo. 
set /p input= 
if %input% EQU 1 set species=Adrynian && GOTO CHAR_DATA 
if %input% EQU 2 set species=Bryniskan && GOTO CHAR_DATA 
if %input% EQU 3 set species=Cruvoshnian && GOTO CHAR_DATA 
if %input% EQU 4 set species=Gangloidian && GOTO CHAR_DATA 
if %input% EQU 5 set species=Human && GOTO CHAR_DATA 
if %input% EQU 6 set species=Hybrid && GOTO CHAR_DATA 
if %input% EQU 7 set species=Sehyapov && GOTO CHAR_DATA 
GOTO choosespecies2 


目前,只有在发生错误的地方是:SpawnCheck和:Masafkel-XC,但我一直在代码的其他部分显示,以防万一有任何其他的错误,可能会导致我目前的问题。

我明白批量脚本编码是一种古老形式 - 特别是对于RPG风格的游戏 - 但任何帮助或更正,和/或信息,为什么这可能是这样的,将不胜感激。谢谢。

+0

你将不得不张贴在“崩溃”一些细节你得到一个错误信息?你有任何可以检查的日志文件吗?我建议批处理可能不是最好的语言。你有没有考虑过HTA? https://en.wikipedia.org/wiki/HTML_Application这是一个古老的技术,但至少你有一个用户界面。 –

+0

...比添加一些jQuery,你有一个大片。这里有一个图书馆看起来优化RPG的:http://www.jqueryrain.com/2015/12/rpg-js-rpg-2d-browser-with-html5-canvas/ –

+0

谢谢。我确实收到一条错误消息,但程序过快关闭,无法阅读它所说的内容。我试图录制“崩溃”,并放慢了视频速度,但图像质量并不是最好的。 “spawn0不被识别”的东西,我假设它与语法有关。不幸的是,我没有任何日志文件。 至于批量怎么可能不是最好的编码语言......是的,我知道,并且明白它是非常古老的,但我的游戏围绕着它是一个批处理游戏的事实。 –

回答

0

我解决了你的问题。 我跑了一个简单的测试与你的代码行,这里是测试

工作测试:

@echo off 
set spawn= spawn0 
if %spawn% == spawn0 GOTO SpawnMenu0 

:SpawnMenu0 
cls 
echo it works 
pause 
exit 

您的原非工作测试:

@echo off 
set spawn= spawn0 
if %spawn%=spawn0 GOTO SpawnMenu0 

:SpawnMenu0 
cls 
echo it works 
pause 
exit 

你的问题是等号

if %spawn%=spawn0 GOTO SpawnMenu0 

它应该在变量后面有一个空格,然后两个等号标志并排,那么像这样的另一个空间:

if %spawn% == spawn0 GOTO SpawnMenu0 

我希望我帮助了SpawnCheck解决您的问题

+0

啊,非常感谢。它工作完美。我认为这肯定与我糟糕的代码编写有关,但我无法指责它(因为我没有这方面的知识)。哇,我怎么会错过这样一个简单的错误?哈!谢谢,你已经帮了很多忙,现在我可以开展业务了。 –