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.

[SOLVED] List users with a specific host

Help for those learning Tcl or writing their own scripts.
Post Reply
G
GeeX
Voice
Posts: 29
Joined: Mon Sep 19, 2005 4:29 am

[SOLVED] List users with a specific host

Post by GeeX »

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

Code: Select all

#  __                __      __    
# /\ \              /\ \  __/\ \   
# \ \ \         __  \ \ \/\ \ \ \  
#  \ \ \  __  /'__`\ \ \ \ \ \ \ \ 
#   \ \ \_\ \/\ \_\ \_\ \ \_/ \_\ \
#    \ \____/\ \__/ \_\\ `\___ ___/
#     \/___/  \/__/\/_/ '\/__//__/ 
#
# 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?
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

[lindex [split @ $userhost] 0]
I'm not sure what this would return :lol:

use

Code: Select all

[lindex [split $userhost @] 1]
like common sense dictates :roll:

Also i'm sure your better off using sbnc itself to calculate it's ammount of users instead of using an outside eggdrop :)
G
GeeX
Voice
Posts: 29
Joined: Mon Sep 19, 2005 4:29 am

Post by GeeX »

Well, but i want to see the users in my chan, that idles without mode +x ;)
But also thanks for your correction, i think i was a little bit unconcentrate :oops: :D
G
GeeX
Voice
Posts: 29
Joined: Mon Sep 19, 2005 4:29 am

Post by GeeX »

Problem solved :)
Post Reply