Code: Select all
bind pubm - "%<word>%" mytrigger
proc mytrigger {nick host hand chan args} {
putserv "PRIVMSG $chan :Leave the <word> alone!"
}
Above is a really simple script that would react whenever <word> was said. Really it should be simple enough to change <word> to whatever you want, and change the text after the : to make it say something different.
put the code above in a .tcl file, then put "source scripts/whatever.tcl" in your *.conf file, then rehash your bot.
2)
Okay, mysql is getting a little more tricky. I've been searching for this sort of thing myself with no luck. For a start, (in the cases I've come across) you need MySQL installed locally, and you can only connect to local databases (my problem as it wasn't my system, I couldn't have MySQL installed locally and I needed to access an external database). If you're still here, then you need to find a module or a tcl addon that will add some MySQL commands, and follow the instructions included.
If you want statistics, I can suggest the
stats module, you can find an example of its use
here