set wchan #yourchan
bind notc - * wproc
proc wproc {nick uhost hand text dest} {
global wchan
if {[regexp {(.*?) did a /whois.*?} $text - wwho]} {
putserv "PRIVMSG $wchan :$wwho just did a /whois on me."
}
}
set wchan "#yourchan"
bind notc - * wproc
proc wproc {nick uhost hand text {dest ""} } {
if {($dest == "" || [isbotnick $dest]) && [regexp {(.+?)\sdid a /whois} $text -> wwho]} {
putserv "PRIVMSG $::wchan :$wwho just did a /whois on me."
}
}
Greedy matching is needed in cases like this (.+? vs .*?) to contain as much of the line as possible. Also need to check the botnick is the one being sent the notice (the bot gets channel notices and without this check can set this script off erroneously).