| View previous topic :: View next topic |
| Author |
Message |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Fri Nov 28, 2008 4:09 pm Post subject: Need some help (how many users on X chan) |
|
|
Hello,
I would like to know how can I put the egg seeing how many peaple are on $chan, how many ops, and voices.
How can i do it ?
Ty. |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Fri Nov 28, 2008 4:31 pm Post subject: |
|
|
im using my own proc:
| Code: | proc chan_users { channel } {
set all_users [chanlist $channel]
set ops 0
set voices 0
set normal 0
foreach chan_user $all_users {
if {[isop $chan_user]} {
incr ops 1
} elseif {[isvoice $chan_user]} {
incr voices 1
} {
incr normal 1
}
}
set all [llength $all_users]
return "$ops $voices $normal $all"
}
|
example:
set users_list [chan_users #channel]
puts $users_list
1 op
0 voices
3 normal
4 overall
u can split it to seperate variables or smth
cheers
P.S.
hint: read in manual about "chanlist" |
|
| Back to top |
|
 |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Fri Nov 28, 2008 7:53 pm Post subject: Ty |
|
|
Thanks !  |
|
| Back to top |
|
 |
|