This is my first AI script it gives your bot the effect of learning.
To teach the bot say something like:
Tree is a Plant
then ask via
What is a tree?
the reply will be:
a tree is a plant
Etc
Im improving it a lot so soon it will recognise correct grammar.
on 1:TEXT:What is *?:#:{
var %item $left($3,-1)
if ($readini(whatis.ini,meh,%item) != $null) {
msg # %item is a $readini(whatis.ini,meh,%item)
}
}
on 1:TEXT:* is a *:#:{
describe # has just learnt something ^-^
writeini whatis.ini meh $1 $4-
}
on 1:ACTION:is a *:#:{
describe # has just learnt something ^-^
writeini whatis.ini meh $nick $3-
}
[17:03] <LikeLakers2[BNC]> the cake is a lie
[17:03] * Legend has just learnt something ^-^
[17:03] <LikeLakers2[BNC]> what is a cake?
Of course, no output. And yes, I know I'm supposed to say "what is a the cake?" but even you can tell its improper English.
Now that I'm done ranting, I'd probably say bmotion is better for me, for this purpose.
Cave_Johnson, use my chacha search socket script at:
http://www.hawkee.com/snippet/7688/
You have to understand that mIRC is not "humanly intellectual," so it's harder than you think to store preset questions and use a couple of simple text event to do the matching. It's also inefficient to store bunch of questions and answers in an INI file when you can use a socket to return the results you're after.
Below is the output from my chacha script:> !chacha what is a tree?
A tree is a perennial woody plant. It is most often defined as a woody plant that has many secondary branches supported clear of the ground on a single main stem or trunk with clear apical dominance.The answer is much more in-depth as you can see. If you like it, please bump up its rating, as some haters lowered it out of spite.Your bot can be mocked and output incorrect results.
You're advised to include the -n switch for the writeini command.
Your snippet reminds me of a socket script I made that connects to chacha search service, which they provide commonly asked questions at: http://www.chacha.com/
ChaCha is a search engine which specializes in a question answering service that uses a technique known as the human search engine.