| View previous topic :: View next topic |
| Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon Apr 27, 2020 8:15 am Post subject: output results in alpabetical order |
|
|
i was wondering if the output could be in alphabetical order as it doesnt seem to be as is:
| Code: |
bind pub n|n .mcheck check_all
set excnickX2 {
"chanserv"
}
proc check_all {nick host handle chan text} {
global excnickX2
# grab the channel members list and exclude the bot from it
set userList [chanlist $chan]
set pos [lsearch -nocase $userList $::botnick]
set userList [lreplace $userList $pos $pos]
# set kick reason
set reasonX55 [join [lrange [split $text ] 0 end]]
if {$reasonX55 eq ""} { set reasonX55 Requested }
# build the list with only people that arent on chan access list
foreach user [split $userList] {
if {![isvoice $user $chan] && ![isop $user $chan] && ![ishalfop $user $chan] && ![matchattr [nick2hand $user] fnmo|fnmo $chan] && [lsearch -nocase $excnickX2 $user] == -1} { lappend voiceList $user }
}
set max 4
if {[info exists voiceList]} {
set len [llength $voiceList]
while {$len > 0} {
if {$len > $max} {
set mode [string repeat "v" $max]
set users [join [lrange $voiceList 0 [expr {$max - 1}]]]
set voiceList [lrange $voiceList $max end]
incr len -$max
} else {
set users [join $voiceList]
set len 0
}
putserv "NOTICE $nick [join $users ","]"
}
puthelp "NOTICE $nick :ALL non Voiced/opped/halfopped users on $chan."
} else {
puthelp "NOTICE $nick :No Voiced/opped/halfopped on $chan."
}
}
|
so output meaning the putserv "NOTICE $nick [join $users ","]"
thnx in advance |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon Apr 27, 2020 3:02 pm Post subject: |
|
|
| thanks spike^^ that seems to do it |
|
| Back to top |
|
 |
|