Simple AI Learner Bot

email me

I created this simple batch file to demonstrate a learning bot…you will help it build its data file named speech.txt. Just copy the below text into a file like AI.cmd, and run it.

@echo off
set BotName=Chatty

title AI %BotName% 1.0 – Learner Bot
color 0b

rem Create the speech file if not exist
if not exist speech.txt echo.>speech.txt

Echo Start up a conversation with %BotName%
echo.

:START
set /p text=”You: ”

REM DYNAMIC QUESTIONS THAT PULL REALTIME INFORMATION
if /i “%text%”==”What time is it?” goto :TIME
if /i “%text%”==”What is the time?” goto :TIME
if /i “%text%”==”What is the date?” goto :DATE

REM OUR SPEECH FILE
for /f “tokens=1,* delims=@” %%a in (speech.txt) do (

if /i “%text%”==”%%a” (
echo.
echo %BotName%: %%b
echo.
goto :START
)
)

echo %BotName%: I don’t know what that means.
set /p answer=%BotName%:  How should this be answered ‘%text%’?
echo %text%@%answer%>>speech.txt
echo %BotName%: Thanks!
echo.
goto :START
:TIME
echo.
echo %BotName%: The time is %TIME%
echo.
goto :START

:DATE
echo.
echo %BotName%: The date is %DATE%
echo.
goto :START