| 1. |
Solve : chatting with CMD? |
|
Answer» hey guys how about...thanks, but thats only part of it i need the user to start talking so if they said Hi: Hello USER: What is your name?: Ashely, and u? set /p name= echo %name% cool name... echo so %name% hows ur day? IF bad GOTO bad IF good goto good :bad echo why? (what ever they said here, it will reply Im sorry) The PROBLEM with IF is that the user has an unlimited range of RESPONSES, choice might be better like so... Code: [Select]Choice /N /C "GBA" /M "How was your day? Good? (G) Bad? (B) Alright? (A)" if errorlevel 2 goto Label1 if errorlevel 3 goto Label2 if errorlevel 4 goto Label3 rem code here... FBQuote from: fireballs on August 16, 2008, 05:30:43 AM The problem with IF is that the user has an unlimited range of responses, choice might be better like so...ok, so far i got this: Code: [Select]title Chat with CMD @echo OFF cls echo Hello mate, what is your name? echo What is your name? set /p name= echo welcome %name% cool name... Choice /N /C "GBA" /M "How was your day? Good? (G) Bad? (B) Alright? (A)" if errorlevel 2 goto Label1 if errorlevel 3 goto Label2 if errorlevel 4 goto Label3 :Label1 cls echo why awesome? :Label2 cls echo why badd? :Label3 cls echo alright? echo sounds like something is going on pausebut it doesn't work at the choice, something wrong?what do you mean doesn't work? i might have gotten the errorlevels wrong try debugging... Code: [Select]choice...blah blah echo %errorlevel%sorry for some reason i skipped a number it should just be... Code: [Select]choice... if errorlevel 1 goto good if errorlevel 2 goto bad if errorlevel 3 goto alriteQuote from: fireballs on August 16, 2008, 05:55:55 AM sorry for some reason i skipped a number it should just be...soo this: Quote title Chat with CMD it suddently closes ok this works:Quote title Chat with CMDhe is probably using XP and you Vista. XP doesnt have choice.exe but Vista does thats the problem i think |
|