simple string, search in input
Hello everybody,
I have made an activeworlds bot which have to react on chat strings.
It has to filter badwords out. The activeworlds software prevents to do that realtime, but reacting on badwords that are said is possible.
If I use this if statement:
Code:
if (aw_string(AW_CHAT_MESSAGE)=="badword")
The problem is this only works when someone 'only' says "badword" and not when saying "hello badword".
I got a suggestion from a friend:
Code:
char* msg = aw_string
(AW_CHAT_MESSAGE);
if (strcmp ("badword", msg) == 0) {
But here also the bot only reacts when I say "badword" and not when saying "hello badword".
I must admit i'm not very good in C++, more like just beginning. I've worked myself trough some examples and the tutorials and faq on this website, but couldn't find an answer for this.
If any one knows a place where this is explained then I would love to hear!