As genius_at_work pointed out, it is difficult to script a self-learning bot. I have made an AI-bot for mirc and although its capabilities are limited, it succeeds in fooling people quite well smile

For an AI chatbot you need the following components:
(1) An eventhandler that decides when to answer somebody who is calling it. My bot is capable of having a conversation with a predefined maximum number of people in a chatroom, ignoring other people who are talking. I use about 10 timers to control the bot in a way that it looks like a human chatter. It is also possible to transfer a conversation from one chatter to another.
(2) A dialog handler that recognizes words and phrases and generates an answer. It also determines what to do after putting the answer on the channel: keep on listening to the chatter, ignore the chatter, go into a second level dialog, etc.
(3) Besides word and phrase recognition it is nice to have some kind of a self-learning system. I use this one:
- the bot logs every sentence that contains 5 or more words (it skips color codes and special characters like , . : : etc)
- if it cannot recognize a word or phrase it will search in the logfile for two lines that contains the first 3 words of a chatter's sentence
- if it finds two lines it takes the first half of the first line and the second half of the second line, combines them and puts that as an answer in the channel

For instance somebody says: "i got a brand new car" and it finds the two lines: "yesterday i got a strange email" and "that is how i got a virus", it will combine them to: "yesterday i got a virus". This is a simple example but sometimes it produces quite nice answers.