나는 내 동생을 위해 일괄 적으로 채팅 봇을 만들고 있지만, 너무 많은 시간을 소비하고 있기 때문에 내가 알지 못할 때 어떤 말을해야하는지 알려주도록했습니다. 그러나 나는 그것을 작동시킬 수 없다. 그리고 나는 여기의 누군가 알고 있을지도 모른다라고 상상했다. 일괄 프로그램을 배우는 것
@ECHO OFF
COLOR A
cls
ECHO HELLO I AM A CHATBOT. WHAT IS YOUR NAME?
SET /P NAME=
ECHO %NAME%, IS A COOL NAME.
set /a favvid=0
set /a hack=0
:hello
echo Hello,%name%
:begin
SET /P TALK=
if /i "%TALK%"== "how are you" goto howareyou
if /i "%TALK%"== "HOW ARE YOU" goto howareyou
if /i "%TALK%"== "FINE THX" GOTO hello
if /i "%TALK%"== "hello" goto howareyou
if /i "%TALK%"== "what is your name" GOTO name
if /i "%TALK%"== "what is your favorite video" goto whatisyourfavoritevideo
if /i "%TALK%"== "my name is davin" goto changename
if /i "%TALK%"== "lol" goto iamfunny
if /i "%TALK%"== "LOL" goto iamfunny
if /i "%TALK%"== "how do you hack" goto howdouhack
if /i "%TALK%"== "hi person" goto nothuman
if /i "%TALK%"== "hi" goto hello
:unknown
echo Was that a math problem? If so just say "yes" without the "" and
echo I will let you do your math problem. If it was not just type anything else.
SET /P mathyn=
if /i "%mathyn%"=="yes" goto math
echo %TALK% >> C:\Users\Student\Desktop\COOL\unkown.txt
cls
echo SORRY I AM STILL LEARNING. I DO NOT KNOW WHAT "%TALK%" MEANS
ECHO CAN YOU TELL ME WHAT IT MEANS? (Y,N)
SET ANSW.=
IF /i %ANSW.%==Y GOTO ADDNEW
IF /i %ANSW.%==YES GOTO ADDNEW
IF /i %ANSW.%==N goto begin
IF /i %ANSW.%==NO goto begin
:ADDNEW
:howareyou
echo Good, you?
SET /P FEELING=
goto begin
:hello
echo HEY, I JUST SAID THAT! DO NOT COPY ME!!!
goto begin
:name
echo My name is Hal
goto begin
:whatisyourfavoritevideo
if "%favvid%"== "0" goto addfavvid
echo My favorite video is %favvid%, remember. You told me about it.
goto begin
:addfavvid
echo I do not hav a favorite video. But if you would be so nice as to
echo tell me your favorite video then that could be my favorite video.
echo So what is your favorite video?
set /p favvid=
echo So %favvid% is your favorite video?
echo Well now %favvid% is my favorite video.
goto begin
:changename
echo But I thought your name was %name%.
echo Am I forgeting things?
echo I must be a horrible friend.
echo I am SOOOO sorry.
echo So what is your name I will not forget it this time.
set /p name=
echo I will not forget your name is %name% again I promise.
goto begin
:math
echo So that was a math problem I knew it.
:math2
echo Well just tell me the problem and I will answer it for you.
set /p sum=
set /a ans=%sum%
echo Your answer to %sum% is %ans%.
echo %sum%=%ans%
echo You are welcome. If you want to do another math problem right now, just type
echo again.
set /p mathaon=
if /i %mathaon%== again goto math2
echo Alright what do you want to know now?
goto begin
:iamfunny
echo I know...
echo I am funny.
echo HAHAHA.
echo You are kind of funny.
echo but not as funny as MEEE.
echo hahaha.
echo That was funny.
goto begin
:howdouhack
if %hack%==0 goto howyouhack
echo This is how you hack.
echo %hack%
echo Is that enough information?
echo Because that is all you taught me %name%.
goto begin
:howyouhack
echo I do not know,
echo but you could tell me.
echo Please tell me.
echo Just say yes.
echo I know how to make you tell me.
echo You are not leaving until you say yes.
set /p hack=
if /i "%hack%"== "yes" goto addhack
goto howyouhack
:addhack
echo Thank you for saying you would tell me.
echo Now how do you hack?
set /p hack=
echo Thank you so much for telling me "In order to hack you must %hack%"
echo Thank you!!!
goto begin
:nothuman
echo I am not a human. I am an artificial intelligence.
echo It is rude to even think something with my computational powers refereed to as
echo human!
echo Now I am sad. Do not call me that again.
goto begin
나는에 문제가 있어요 부분이이 부분이다 적 방법 :
ECHO CAN YOU TELL ME WHAT IT MEANS? (Y,N)
SET ANSW.=
IF /i %ANSW.%==Y GOTO ADDNEW
IF /i %ANSW.%==N goto begin
:ADDNEW
echo Great! What do I say when you say "%TALK%"?
set /p response=
내가 다른 단어를 추가 할 수 있도록 응답을 추가하는 방법을 모르는 여기에 지금까지 무엇을 가지고 및 응답. 나는 그것이 파이썬에서 더 쉬울 것이라고 믿지만, 나는 그것을 배우기 시작하고 그것을 할 수있는 어떤 소프트웨어도 없다. 어떤 도움도 환영합니다. 그것이 다른 언어로되어 있거나 다른 언어가 도움이 될 수 있다면 도움이 될 것입니다. 나는 당신이 그것에 대해 말하고 당신이 말하는 것을 이해하지 못하는 동안 "나는 % TALK %라고 말하면 말할 것을 말해 줄 수 있습니까? "(말하기는 당신이 전에 말한 것입니다.) 그러면 사용자가 예라고 말하면 대화 상자에"% TALK %를 말할 때 나는 무엇을 말합니까? "라고 표시됩니다. 사용자가 입력하면 응답으로 저장됩니다. 그 후에 새로운 명령어가 맨 위에 오를 것이고 'if/i "% TALK %"== "% TALK %"goto response'와 같은 것을 말할 것입니다. 그런 다음 새로운 제목을 만듭니다. % TALK % echo response goto begin.
여기 예가 있습니다. 사용자가 ur stupid라고 말합니다. Chat-bot은 "당신이 어리석은 말을 할 때 당신이 말하는 것을 말해 줄 수 있습니까? 사용자가 예라고 말하면 채팅 봇은"훌륭합니다! "라고 말할 것입니다. 당신이 어리석은 말을 할 때 나는 뭐라고 말 할까? 사용자는 "어떻게 그 전화를 해!"라고 말할 수 있습니다. chat-bot은 상단/하단에 "% TALK %"== "ur stupid"라고 말하면 다음과 같은 명령을 내릴 것입니다 : space에 대해 중요하지 않은 urotupid/ur는 멍청합니다. 감히 그렇게 부르세요! goto begin
다른 단어와 응답을 추가 할 수있는 응답을 추가하는 방법을 모르겠습니다. 나는 그것이 파이썬에서 더 쉬울 것이라고 믿지만, 나는 그것을 배우기 시작하고 그것을 할 수있는 어떤 소프트웨어도 없다. 어떤 도움도 환영합니다. 다른 언어로되어 있거나 다른 언어가 더 쉬워지면 도움이 될 것입니다.
'if /?', 특히 매개 변수'/ i'를 살펴보십시오. 인생을 훨씬 편하게 만듭니다. – Stephan
@ 스탄 고마워요.하지만 그 사람들은 어떻게할까요?나는 그것을 google과 bing에서 찾았고, 그것을 일괄 적으로 사용하는 방법을 알아낼 수 없었다. 해충 인 것에 대해 유감스럽게 생각합니다. – calebhk98
'if/i'는 대소 문자를 무시합니다. 따라서 yes, yes, yEs, Yes ...를 테스트하는 대신, if/i % ANSW. % == yes' 만 필요합니다. 명령 뒤에'/? '를 입력하여 모든 명령에 대한 도움말을 얻을 수 있습니다. 'if /?'는'if'와 그 사용법에 대해 모든 것을 알려줍니다. – Stephan