bind pub "-|-" !pp ping_proc
proc ping_proc {nick uhost handle channel arg} {
set nr [lindex $arg 0]
set target [lindex $arg 1]
set i [exec /bin/ping -c $nr $target]
fileevent $i readable "outp $i"
}
proc outp {i channel} {
putquick "PRIVMSG $channel :[gets $i]"
if [eof $i] {close $i}
}
when i type the following in the channel i get this error in the bot..
Tcl error [ping_proc]: can not find channel named "PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.055 ms