| View previous topic :: View next topic |
| Author |
Message |
krieg Voice
Joined: 20 Nov 2007 Posts: 13
|
Posted: Sat Dec 01, 2007 11:41 pm Post subject: |
|
|
| iamdeath wrote: | | krieg wrote: | for example:
!kick nick reason
!kick Slay You have bad nickname, change it! Try again to join.
*** Slay was kicked by Botnick (You have bad nickname, change it! Try again to join.) |
Find this code:
| Code: | 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: | 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. |
it is not working.. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Dec 02, 2007 3:05 am Post subject: |
|
|
krieg: You need to be more specific with the "it is not working.." statement.
For any assistance to be given an error message (if any) needs to be posted and/or exactly what is (or not) happening.
Posting the result of ".set errorInfo" would be especially helpful.  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Dec 02, 2007 12:18 pm Post subject: |
|
|
| iamdeath wrote: | Find this code:
| Code: | 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: | 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: | 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"
}
} |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|