dimanche 3 avril 2016

Batch not recognising commands

I'm trying to make a text adventure using a batch file (probably not the best idea but it's just for fun.) Anyway I have a section where if I don't turn echo off, I can see that it skips setting a variable and everything included in between the parentheses after an if statement.

    if /i "%input%"=="inspect drawer" (
           echo You open the drawer and you see a key in the drawer.
           set /p input=Type back to go back.
           if /i "%input%"=="back" goto RightDoor
           if /i "%input%"=="take key" (
                echo you take the key.
                set key=1
                goto :RightDoor)
           echo "%input%" is not a valid command.)

The text that's after the first if statement is what it doesn't recognize... any ideas why?

Aucun commentaire:

Enregistrer un commentaire