Code: Select all
bind pub - !bans pub:banes
proc pub:banes { nick uhost handle chan arg } {
if { [isop $nick $chan] || [ishalfop $nick $chan] || [isvoice $nick $chan] } {
set channel $chan
if { $arg!="" } {
set channel $arg
}
set banli [chanbans $channel]
set banes 0
foreach x $banli {
set banner [lindex [split [split [lindex [split [lindex [split $x] 1] !] 0] \]] |] 0]
if { [lsearch [lrange [split $banes] 1 end] $banner]==-1 } {
set banes "$banes $banner"
putlog [lrange [split $banes] 1 end]"
set banarray($banner) 1
} else {
set banarray($banner) [expr $banarray($banner)+1]
putlog "$banarray($banner)"
}
}
set listabaneador [lrange [split $banes] 1 end]
set textofin 0
putlog "longitud de baneado [llength $listabaneador]"
for { set i 0 } { $i<[llength $listabaneador] } { incr i } {
if { $i==[expr [llength $listabaneador]-1] } {
set textofin "$textofin y $banarray([lindex $listabaneador $i]) son de [lindex $listabaneador $i]. "
} else {
set textofin "$textofin, $banarray([lindex $listabaneador $i]) son de [lindex $listabaneador $i]"
putlog "$textofin"
}
}
set final [lrange [split $textofin] 1 end]
set text [join $final]
putlog "$text"
putserv "PRIVMSG $chan :There is [llength $banli] bans of 100 posible en in the channel $channel from which $text"
}
}
This is one of the scripts i made to count the number of bans in a chan and sum the bans made by each op in that chan. The problem is when i have a nick with special chars. Normaly the [ ] chars. For exemple, if i have a nick like [test] , it'll return:
{\\\{\\\[test\\} {{}} and then ..
i've tried reading all posts but i still don't know how i could solve it.. sorry if this as already been treated in other post but i'de apreciate some help. thx for allTcl error [pub:banes]: can't read "banarray(\{\[test)": no such element in array

