Goto war unerwartet zu diesem Zeitpunkt batch-windows 7 starter

Dieser code wurde entwickelt, um ähneln eine einfachere version von Pokemon battle gameplay. Ich habe nur codiert in den Angriffen. Ich habe getestet, und festgestellt, dass eine Fehlermeldung (Goto war unerwartet zu dieser Zeit), Wann immer der Benutzer bestätigt den Angriff. WARNUNG!! Code 96 Zeilen lang. Am Ende werde ich das problem Abschnitt, so können Sie überspringen diese erste große Brocken.

@echo off
Set H1=20
Set A1=8
Set D1=6
Set S1=5
Set H2=14
Set A2=5
Set D2=4
Set S2=8
:Begin
CLS
Echo Bulbasur
Echo %H2%/14      /\       
Echo           (__) ___  
Echo           l __lo.ol 
Echo           l_\ l_\"  
Echo.        
Echo     _ 
Echo *  /\ 
Echo \\l  )
Echo  \\__l   Charmander
Echo             %H1%/20
Echo -Attack -Capture
Echo -Item   -Run 
Set /p Move=Action?
If %move%==Attack goto Attack
If %move%==Catpure goto capture
If %move%==Item goto Item
If %move%==Run Goto Run
Echo I'm sorry, Charmander can't do that. 
Pause
goto Begin
:Attack
ClS
Echo Attacks
Echo 1)Tackle
Echo 2)Growl
Echo 3)Ember
Echo 4)Scratch
Set /p attack=Which one?
If %attack%==Tackle goto Tackle
If %attack%==1 goto Tackle
If %attack%==Growl Goto Growl
If %attack%==2 goto Growl
If %attack%==Ember goto Ember
If %attack%==3 goto Ember
If %attack%==Scratch goto Scratch
If %attack%==4 goto Scratch
If %attack%==Cancel goto Begin
Echo I didn't get that
Goto Attack
:Tackle
CLS
Echo Tackle Hits The opponent where it hurts. EVERYWHERE.
Echo Do you want to?
set /p accept=Yes/No?
If %acccept%==Yes goto Combat
If %acccept%==No goto Begin
Echo I didn't get that.
goto Tackle 
:Growl
CLS
Echo Growl lowers the opponents attack.
Echo Do you want to?
set /p accept=Yes/No?
If %acccept%==Yes goto Status
If %acccept%==No goto Begin
Echo I didn't get that.
goto Growl
:Scratch
CLS
Echo Scratch hits the foe with a claw.
Echo Do you want to?
set /p accept=Yes/No?
If %acccept%==Yes goto Combat
If %acccept%==No goto Begin
Echo I didn't get that.
goto  Scratch
:Ember
CLS
Echo Ember hits the opponent with a small fire.
Echo Do you want to?
set /p accept=Yes/No?
If %acccept%==Yes goto Combat
If %acccept%==No goto Begin
Echo I didn't get that.
goto Ember
:Combat
CLS
If NOT %attack%==Growl If NOT %attack%==2 set /a H2=%H2%-(%A1%^2/%D2%)
set /a H1=%H1%-(%A2%^2/%D1%)
goto Begin
:Status
CLS
Set /a A1=%A1%-1
goto Combat

Problem:

:Tackle
CLS
Echo Tackle Hits The opponent where it hurts. EVERYWHERE.
Echo Do you want to?
set /p accept=Yes/No?
If %acccept%==Yes goto Combat
If %acccept%==No goto Begin
Echo I didn't get that.
goto Tackle 

Den code bekommt hier feine, aber sobald ich hier bin, kann es nicht erwarten, dass die goto-Befehle. Jeder kann dieses Problem beheben Rindfleisch? (Hinweis: die Bekämpfung ist nur ein Beispiel. Keiner der Angriffe arbeiten.) EDIT: Wenn der Benutzer legt in "ja","Nein",Kauderwelsch oder nichts, liefert es noch die gleiche Fehlermeldung (goto war unerwartet zu dieser Zeit)

  • Ich bin gespannt, was die downvotes; Fragesteller geposteten code, ausgesondert-ein Beispiel problem-Gebiet, und gab sogar die Fehlermeldung. Scheint eine gute Frage zu mir. Ist es nur Verachtung für batch-Dateien? Das sollte nicht beeinflussen, ob die Frage gut ist oder nicht.
  • wahrscheinlich, weil er veröffentlicht seine gesamte Skript. Und dann veröffentlicht eine weitere Kopie von den problematischen code. Er sollte nur gebucht haben, den code, dass war problematisch.
  • If %move%==Catpure goto capture Ich weiß, dass Katzen purre, aber ich denke, das ist ein Tippfehler ^^
InformationsquelleAutor user1205760 | 2012-03-19
Schreibe einen Kommentar