i'm looking for a tcl script which can be used to do multivoices (!v nick1 nick2).
does it exist or what could be the lines of code to do that kind of things?
thanks!!

Code: Select all
bind pub o|o !v pub:v
proc pub:v {nick host handle channel arg} {
global botnick
if {[llength $arg] > 0} {
putserv "NOTICE $nick :\002Usage:\002 !v <nick1> [nick2] [nick3] .. etc."
return 0 }
if {![botisop $channel]} {
putserv "NOTICE $nick :I'm not oped in $channel."
return 0 }
set arg [string tolower $arg]
foreach user $arg {
if {![onchan $user $channel] || ![isop $user $channel] || ![isvoice $user $channel] || $botnick == $user} { continue }
pushmode $channel +v $user
}
}
Maybe it is better if you tested it first, before posting it. On a first glance I counted about 5 serious mistakes.caesar wrote:I haven't tested it, but should work fine.Code: Select all
bind pub o|o !v pub:v proc pub:v {nick host handle channel arg} { global botnick if {[llength $arg] > 0} { putserv "NOTICE $nick :\002Usage:\002 !v <nick1> [nick2] [nick3] .. etc." return 0 } if {![botisop $channel]} { putserv "NOTICE $nick :I'm not oped in $channel." return 0 } set arg [string tolower $arg] foreach user $arg { if {![onchan $user $channel] || ![isop $user $channel] || ![isvoice $user $channel] || $botnick == $user} { continue } pushmode $channel +v $user } }
Code: Select all
putserv "NOTICE $nick :\002Usage:\002 !v <nick1> [nick2] [nick3] .. etc."
Code: Select all
putserv "NOTICE $nick :\002Usage:\002 !v <nick1> \[nick2\] \[nick3\] .. etc."
Code: Select all
if {![onchan $user $channel] || ![isop $user $channel] || ![isvoice $user $channel] || $botnick == $user} { continue }
Code: Select all
if {![onchan $user $channel] || [isop $user $channel] || [isvoice $user $channel] || $botnick == $user} { continue }
Code: Select all
set channel [string tolower $channel]
set botnick [string tolower $botnick]
Code: Select all
foreach user $arg {
Code: Select all
foreach user [split $arg] {
You did [string tolower $botnick] before comparing it to the $user, which is 1 problem solved.caesar wrote:from:to:Code: Select all
foreach user $arg {
Code: Select all
foreach user [split $arg] {
The question for caesar is: when did you use the first list command?Papillon wrote: try splitting $arg before doing list commands on it...
Such flames are very nice, but certainly out of place. And the smiley next to it makes it even more ambiguous. Also, it is a lousy practise to first post code (with errors) and then refuse to listen to comments on it.caesar wrote: flames]If you don't consider them then do yourself the code.[/flames]
How difficult is that question? You refused to read and properly answer the question.egghead wrote: The question for caesar is: when did you use the first list command?