egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need some help (how many users on X chan)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Fri Nov 28, 2008 4:09 pm    Post subject: Need some help (how many users on X chan) Reply with quote

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 ? Rolling Eyes

Ty.
Back to top
View user's profile Send private message
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Fri Nov 28, 2008 4:31 pm    Post subject: Reply with quote

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

Code:
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"
Back to top
View user's profile Send private message Visit poster's website
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Fri Nov 28, 2008 7:53 pm    Post subject: Ty Reply with quote

Thanks ! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber