CosmicTruth
Technical User
i have the following code...
there are a zillion of these that just listen for a certain string, then reply a string and print into the console what the robot has replied.
what i would like to do (if i were a programmer) is to have a text file with all the common string and responses like...
be happy bot=i am a happy bot
hello bot=hello
bot hello=hello
bot define bot=a robot is a computer controlled entity like me
the program would open the file, look to see if the message string is in the text file line by line, if it is get the response and store it to a variable like response, then do the rest like normal:
can someone code this for me? ive been reading alot of books but cant grasp this, i just need a little kick in the b*%t to get me going.
im using visual c++2005 express in win XP
(me and my bot)
mnap=me not a programmer : ))
CosmicTruth
Code:
if(!_stricmp(message, "be happy bot"))
{
aw_say("i am a happy bot");
cout << "[Bot]: i am a happy bot\n";
}
there are a zillion of these that just listen for a certain string, then reply a string and print into the console what the robot has replied.
what i would like to do (if i were a programmer) is to have a text file with all the common string and responses like...
be happy bot=i am a happy bot
hello bot=hello
bot hello=hello
bot define bot=a robot is a computer controlled entity like me
the program would open the file, look to see if the message string is in the text file line by line, if it is get the response and store it to a variable like response, then do the rest like normal:
Code:
aw_say(response); //make the bot say the response
cout << "[Bot]: " << response << "\n"; //put it on the console
im using visual c++2005 express in win XP
(me and my bot)
mnap=me not a programmer : ))
CosmicTruth