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.

!userlist script by Tosser^^

Support & discussion of released scripts, and announcements of new releases.
Post Reply
n
nsrafk
Halfop
Posts: 73
Joined: Fri May 11, 2007 12:25 am

!userlist script by Tosser^^

Post by nsrafk »

Code: Select all

#############################################################################################################################################################################################
## Userlist Version 1.01 By Tosser^^ ########################################################################################################################################################
## Contact: IRC: Nickname: Tosser^^ Channels: #ShoVe & #bots.net & #CupCentrum & #SLuiP @ Quakenet.org Email: chris@cs-room.com #############################################################
## Useage: !userlist in channel, need atleast global +o or channel +f flags to dump userlist ################################################################################################
## Output: (( Handle: Users handle on the bot || Nickname: offline or nickname displayed || Host(s): The hostnames added to the bot for this user || Channel Flags: Users channel flags )) ##
#############################################################################################################################################################################################

# Bind(s)

bind pub m|m !userlist user_list 

#----------------------------------------------------------------------------

# The Script                                                                 
# Do not edit anything beyond this line unless you know what you are doing!!
 
#----------------------------------------------------------------------------

proc user_list {nick uhost hand chan text} { 
if { [userlist |amnovf $chan] == "" } { 
putserv "NOTICE $nick :No users found in my userlist for $chan" 
} else { 
putquick "NOTICE $nick :Userlist for $chan" 
foreach user [userlist |amnovf $chan] { 
set usersnick [hand2nick $user] 
if { $usersnick == "" } { 
putquick "NOTICE $nick :(( Handle: $user || Nickname: Offline, or not in any of the bots channels. || Host(s): [getuser $user HOSTS] || Channel Flags: +[lindex [split [chattr $user $chan] |] 1] ))" 
} else { 
putquick "NOTICE $nick :(( Handle: $user || Nickname: $usersnick || Host(s): [getuser $user HOSTS] || Channel Flags: +[lindex [split [chattr $user $chan] |] 1] ))" 
} 
} 
putquick "NOTICE $nick :End of list." 
} 
}

putlog "Userlist Version 1.01 By Tosser^^ Loaded!!, Use !userlist in channel to dump the userlist"

Im wondering if anybody could add a bit of code to make it work this way:

Lets say i have 21 bots divided up in 5 groups (4 bots in each group + a hub bot). A main channel like #mainchan where all the bots is in would then be the headquarters. So, if i load "this" !userlist script, i'd then have
to do like;

!userlist #chan1 (a chan where 1 of the bot groups is in)
!userlist #chan2 ( ... )
etc

Atm ive loaded the userlist.tcl script in 5 bots (1 bot for each group) so i can do !userlist in any channel one of my groups is in, to get a response, hehe. Would love to make it work like the way i described above :)

Does it make any sense? :)
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

I'm quite sure he could, try emailing chris@cs-room.com.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

That email address is not used anymore, this is also a very old script (one of my first scripts!).

Code: Select all

bind pub -|- !userlist pub:userlist

proc pub:userlist {nickname hostname handle channel text} {
    if {![matchattr $handle nmovf|nmovf $channel]} {
        putserv "NOTICE $nickname :You have no access to this command!"
    } else {
        if {$text != ""} {
            if {![string index [set channel [lindex [split $text] 0]] 0] != "#"} {
                set channel "#$channel"
            }
            if {![validchan $channel]} {
                putserv "NOTICE $nickname :You specified an invalid channel. Usage: $lastbind ?#channel? (where channel is optional)."
                return
            }
        }
        if {[userlist |nmovf $channel] == ""} {
            putserv "NOTICE $nickname :No users for $channel."
        } else {
            putserv "NOTICE $nickname :Userlist for $channel."
            foreach user [userlist |nmovf $channel] {
                if {$user == ""} { continue }
                putserv "NOTICE $nickname :(( Handle: $user || Nickname: [expr {[hand2nick $user] == "" ? "Offline" : "[hand2nick $user]"}] || Hosts: [join [getuser $user HOSTS] ", "] || Channel flags: +[lindex [split [chattr $user $channel] |] 1] ))"
                }
            }
            putserv "NOTICE $nickname :End of list."
        }
    }
}
Not tested!
r0t3n @ #r0t3n @ Quakenet
n
nsrafk
Halfop
Posts: 73
Joined: Fri May 11, 2007 12:25 am

Post by nsrafk »

Woo, thanks. Let me test it out and see if it works good :)
n
nsrafk
Halfop
Posts: 73
Joined: Fri May 11, 2007 12:25 am

Post by nsrafk »

Hehe, first i needed to remove a "}" :)

Then on !userlist #channel i get this in partyline:

[22:26] Tcl error [::bc::onEncryptedText]: can't use non-numeric string as operand of "!"


... dont mind the ::bc:: stuff, its because im using blowcrypt :)
Post Reply