Updated 2011-07-25 10:07:38 by RLE

Jos Decoster 22-dec-2006

To automatically redirect Eggdrop questions from #tcl to #eggtcl, I added this proc to tkchat:
 proc ::tkchat::Bot { nick msg msgtype mark timestamp } {
 
     variable nick_seen
 
     if { ![string equal $msgtype NORMAL] } {
          return
     }
 
     if { [info exists nick_seen($nick)] &&
          [expr {$timestamp - $nick_seen($nick)}] < 3600 } {
         return
     }
 
     if { ![string match -nocase "*eggdrop*" $msg] } {
         return
     }
 
     tkjabber::msgSend "$nick, for more information about eggdrop, also take a look at \#eggtcl or http://wiki.tcl.tk/16656"
 
     set nick_seen($nick) $timestamp
 }

and called it from ::tkchat::addMessage like this:
 tkchat::Bot $nick $msg $msgtype $mark $timestamp