Trying to get this command to work in pm, what am I doing wrong with the proc?? log file just keeps saying should be {nick uhost hand chan text}, can someone please show me correct way? Thanks
Thank you, I do get an error that a close bracket is missing,trying to figure out where it goes lol.... so no way to have it without having to use #mychan?
variable nicks_per_line 5
variable chan_for_this #mychan
bind msg f|f !userlist msg:userlist
proc msg:userlist {nick uhost hand text} {
if {![string length [set chan [lindex [split $text] 0]]]} {
set chan $::chan_for_this
}
if {![validchan $chan]} {
putserv "PRIVMSG $nick :$chan is not valid."
} elseif {![botonchan $chan]} {
putserv "PRIVMSG $nick :I am not on $chan."
} elseif {![string length [userlist | $chan]} {
putserv "PRIVMSG $nick :The userlist for $chan is empty."
} else {
foreach user [userlist | $chan] {
lappend spam $user
if {[llength $spam] >= $::nicks_per_line} {
putserv "PRIVMSG $nick :[join $spam ", "]."
unset spam
}
}
if {[info exists spam]} {
putserv "PRIVMSG $nick :[join $spam ", "]."
}
putserv "End of userlist."
}
}
This one, if you don't put a channel, it will use the hardcoded variable chan_for_this as your channel. This fixes the bracket issue as well. This should work for ya
speechles wrote:
This one, if you don't put a channel, it will use the hardcoded variable chan_for_this as your channel. This fixes the bracket issue as well. This should work for ya
Thank you, it helps I guess it isn't possible to make $chan work in pm w/o having to hardcode the channel in, so I assume only commands in open room know what the roomname is but pm don't.