Code: Select all
bind pubm - * pubm:parsemsg
proc pubm:parsemsg {nick uhost hand chan text} {
if {![regexp "hey bot, you're ugly" $text]} { return }
putserv "PRIVMSG $chan :$nick, Look in the mirror, stupid."
}
Code: Select all
bind pubm - * pubm:parsemsg2
proc pubm:parsemsg2 {nick uhost hand chan text} {
if {![string match "<lower-case message to match here>" [string tolower $text]]} { return }
putserv "PRIVMSG $chan :<reply here>"
}
Code: Select all
bind msg - * lex_msg
proc lex_msg {nick uhost hand chan arg} {
set words $arg
if {[string match "lex where are you?" [string tolower $words]]} { putserv "PRIVMSG $nick :I'm here, $nick: [channels]" }
return 1
}
[code]
Code: Select all
proc lex_msg {nick uhost hand arg} {
Code: Select all
# random responses to the word "hello"
set ranhello {
"Hi there"
"hello, whats up"
"hello"
"hi"
"hey whats up"
"yeah, yeah hi HI"
"hello, nice to see yea!"
"Hi i'm happy today!!"
}
bind pub - hello pub_hello2
# random hello proc
proc pub_hello2 {nick uhost hand chan $ranhello} {
global ranhello
if [rand 2] {
putchan $chan "[lindex $ranhello [rand [llength $ranhello]]] $nick"
}
return 1
}