This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Need some help (how many users on X chan)

Help for those learning Tcl or writing their own scripts.
Post Reply
g
garfwen
Halfop
Posts: 61
Joined: Wed Mar 12, 2008 5:16 pm

Need some help (how many users on X chan)

Post by garfwen »

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 ? :roll:

Ty.
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Post by tomekk »

im using my own proc:

Code: Select all

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

Code: Select all

1 0 3 4
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"
g
garfwen
Halfop
Posts: 61
Joined: Wed Mar 12, 2008 5:16 pm

Ty

Post by garfwen »

Thanks ! :)
Post Reply