How to get my ai to work

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

darkmoon3009

Thread Starter
Joined
Jan 5, 2013
Messages
1
Code:
@echo off

:Main
set /p  Input=

:wrong
echo Im sorry i have not been programmed to reply to those words.
echo If you think that what you said should be involved in the main
echo program then please email me at "[email protected]"
pause



if "%Input%"=="Hello"
(
echo Hello there. 
goto Main
)
else
(
goto wrong
)
goto loop
pause
I am trying to make it so if the player said "Hello" then it will run the code but also if they type "Hello robot" then it would still run it because they said hello. However i dont know how to allow spaces or how to make the AI check if they included the word. If the user uses two words then it will choose the first word used.

Thanks for help
 

foxidrive

Banned
Joined
Oct 20, 2012
Messages
793
Maybe this will give you some ideas:

Code:
@echo off

:Main
echo.
set "input="
set /p "Input=Say something interesting: "


echo "%input%"|findstr  /i /c:"hello" >nul
if not errorlevel 1 (echo Hello there. & goto :Main)
echo "%input%"|findstr  /i /c:"why?" >nul
if not errorlevel 1 (echo Why not? & goto :Main)
echo "%input%"|findstr  /i /c:"swearword" >nul
if not errorlevel 1 (echo Oh Please!  I'm not that kind of AI! & goto :Main)


:wrong
if not defined input goto :main
echo Im sorry i have not been programmed to reply to those words.
echo If you think that what you said should be involved in the main
echo program then please email me at "[email protected]"
pause
goto :main
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top