# If your network supports multiple targets for PRIVMSG, use this one:
set amsg_max_targets 6
proc amsg msg {
set m $::amsg_max_targets
set t {}
foreach c [channels] {
if {[botonchan $c]&&[llength [lappend t $c]]==$m} {
puthelp "PRIVMSG [join $t ","] :$msg"
set t {}
}
}
if {[llength $t]} {
puthelp "PRIVMSG [join $t ","] :$msg"
}
}
# if it doesn't, use this (slower):
proc amsg msg {
foreach c [channels] {
if {[botonchan $c]} {
puthelp "PRIVMSG $c :$msg"
}
}
}
# dcc interface to the amsg proc
bind dcc n|- amsg dccamsg
proc dccamsg {h i a} {amsg $a}