iamdeath wrote:Find this code:
Code: Select all
proc proc_kick { nick uhost hand chan text } {
if {[onchan $text]} {
putquick "KICK $chan $text :Requested"
} else { putserv "PRIVMSG $chan :\002$text\002 Not In Channel: \002$chan\002" }
}
Replace with this:
Code: Select all
proc proc_kick { nick uhost hand chan text } {
set reason1 [lrange $text 1 end]
if {[onchan $text]} {
putquick "KICK $chan $text :$reason1"
} else { putserv "PRIVMSG $chan :\002$text\002 Not In Channel: \002$chan\002" }
}
It should kick with a reason now.
A few issues here, you use $text both as a string and as a list at the same time. Decide to use one form, clearly indicating which.
As for the syntax of "KICK", it's "KICK <channel> <nickname> :<reason>". In your case, if "text" holds both the nickname and reason as a list, you'd be supplying too many arguments to the kick-command (in effect, the kick-reason would be the second word in "text", dropping anything beyond it).
Also, if you do not specify which channel to test (when using the onchan command), it'll see if the nickname is on any channel the eggdrop is monitoring rather than any speciffic.
Now, since you use pub-trigger, having "text" as a list is not an option, as users generally can't be trusted to provide valid list-structures. Hence, don't use lindex/lrange directly on it.
Somewhat fixed, no support or warranties of any kind provided. Still relies on the binding to determine access to the command (binding not included).
Code: Select all
proc proc_kick [list nick host hand chan text] {
set target [lindex [split $text] 0]
set reason [lindex [split $text] 1 end]
if {[onchan $target $chan]} {
putserv "KICK $chan $target :$reason"
} else {
puthelp "PRIVMSG $chan :$target not in channel"
}
}