| View previous topic :: View next topic |
| Author |
Message |
nsrafk Halfop
Joined: 11 May 2007 Posts: 73
|
Posted: Thu Mar 20, 2008 11:57 am Post subject: !userlist script by Tosser^^ |
|
|
| Code: | #############################################################################################################################################################################################
## 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?  |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Thu Mar 20, 2008 12:13 pm Post subject: |
|
|
| I'm quite sure he could, try emailing chris@cs-room.com. |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Thu Mar 20, 2008 1:02 pm Post subject: |
|
|
That email address is not used anymore, this is also a very old script (one of my first scripts!).
| Code: | 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 |
|
| Back to top |
|
 |
nsrafk Halfop
Joined: 11 May 2007 Posts: 73
|
Posted: Thu Mar 20, 2008 5:12 pm Post subject: |
|
|
Woo, thanks. Let me test it out and see if it works good  |
|
| Back to top |
|
 |
nsrafk Halfop
Joined: 11 May 2007 Posts: 73
|
Posted: Thu Mar 20, 2008 5:27 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
|