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 

[SOLVED] List users with a specific host

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


Joined: 19 Sep 2005
Posts: 29

PostPosted: Sun Feb 12, 2006 5:45 pm    Post subject: [SOLVED] List users with a specific host Reply with quote

Hello, my problem is:
I want to get all the users that have a specific host. Thats the Script:

Code:

#  __                __      __   
# /\ \              /\ \  __/\ \   
# \ \ \         __  \ \ \/\ \ \ \ 
#  \ \ \  __  /'__`\ \ \ \ \ \ \ \
#   \ \ \_\ \/\ \_\ \_\ \ \_/ \_\ \
#    \ \____/\ \__/ \_\\ `\___ ___/
#     \/___/  \/__/\/_/ '\/__//__/
#
# sBnc user Script by LaW.
#
# Don't change anything.
# Report bugs to #GeeX on Quakenet.


#  Count sbnc user

  #  configuration

     #  variables

        set sbnc(trigger)   "\!"
        set sbnc(version)   "1.1"
        set sbnc(author)    "LaW (#GeeX on Quakenet)"

     #  bindings

        bind pub n $sbnc(trigger)sbnc pub:bnc

     #  copyright

        putlog "sBnc user Script version $sbnc(version) scripted by $sbnc(author)"

     #  source (again DO NOT change anything if you are not 100% sure)

        proc pub:bnc { nick uhost hand chan text } {
          set cmd [lindex $text 0]
          if {$cmd == "list"} {
           set sbncuser 1
           foreach nick [chanlist $chan] {
            set userhost [getchanhost $nick]
            if {[string match *1988* [lindex [split $userhost @] 0]]} {
             incr sbncuser
            }
           }
          putquick "PRIVMSG $chan :\0031,0\x5B\0032\002\xBB\002\0031 $bncuser \0032\002\xAB\002\0031\x5D\x5B\0032\002\xBB\002 \0031sBNC users in $chan, are powered by #GeeX \0032\002\xAB\002\0031\x5D\003"
         }
         if {$cmd == "check"} {
          set nomodex {}
          foreach user [chanlist $chan] {
           set userhost [getchanhost $user]
           if {[string match *myGeeX.de* [lindex [split @ $userhost] 0]] || [string match *62.75.169.132* [lindex [split @ $userhost] 0]] } {
            lappend nomodex $user
           }
          putquick "PRIVMSG $chan :\0031,0\x5B\0032\002\xBB\002\0031 User without Mode +x \0032\002\xAB\002\0031\x5D\x5B\0032\002\xBB\002\0031 $nomodex \0032\002\xAB\002\0031\x5D\003"
         }
        }
       }


But it returns nothing. Can you help me?
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Mon Feb 13, 2006 2:33 am    Post subject: Reply with quote

Code:
[lindex [split @ $userhost] 0]


I'm not sure what this would return Laughing

use

Code:
[lindex [split $userhost @] 1]


like common sense dictates Rolling Eyes

Also i'm sure your better off using sbnc itself to calculate it's ammount of users instead of using an outside eggdrop Smile
Back to top
View user's profile Send private message
GeeX
Voice


Joined: 19 Sep 2005
Posts: 29

PostPosted: Mon Feb 13, 2006 8:20 am    Post subject: Reply with quote

Well, but i want to see the users in my chan, that idles without mode +x Wink
But also thanks for your correction, i think i was a little bit unconcentrate Embarassed Very Happy
Back to top
View user's profile Send private message
GeeX
Voice


Joined: 19 Sep 2005
Posts: 29

PostPosted: Mon Feb 13, 2006 10:23 am    Post subject: Reply with quote

Problem solved 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