| View previous topic :: View next topic |
| Author |
Message |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Sun Feb 21, 2010 5:16 pm Post subject: |
|
|
Matter of fact, I do:
[04:42:30] Tcl error [kickban]: illegal channel: Testeee
"Testeee" was the nick I was testing it on. So the problem should be in this line:
| Code: | | putserv "MODE $chan +b [maskhost $whom 0]" |
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Feb 21, 2010 5:28 pm Post subject: |
|
|
Actually, it's not in that line. The error you recieve is a tcl error, not an error reported from the irc server. I'd rather look at either onchan or getchanhost - most likely the parameters got mixed up in one of those commands.
Now that I look closer, that's a very prominent difference between the kick_user and kickban procs - the order of the arguments for onchan. Proper syntax is "onchan <target> [channel]", so make sure you've got something along these lines in your code...
| Code: | ...
} elseif {![onchan $whom $chan]} {
... |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Sun Feb 21, 2010 7:07 pm Post subject: |
|
|
Okay, I made a few tweaks and now I get this error:
Tcl error [user_reason]: wrong # args: should be "lrange list first last"
| Code: |
bind pub o|o !kb user_reason
proc user_reason {nick host hand chan text} {
set list [split $text]
set whom [lindex $list 0]
set reason [join [lrange $list 1 end]]
if {$whom == ""} {
putserv "PRIVMSG $chan :You must specify a nick to kickban."
} elseif {![onchan $whom $chan]} {
putserv "PRIVMSG $chan :$whom is not here."
} else {
putserv "MODE $chan +b [maskhost [getchanhost $whom $chan] 0]"
if {$reason == ""} {
puthelp "KICK $chan $whom :Requested by $nick."
} else {
puthelp "KICK $chan $whom :$reason"
}
}
}
|
Did away with the if {$hand !=} { part.. for now at least.
Last edited by Luminous on Sun Feb 21, 2010 10:49 pm; edited 1 time in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Feb 21, 2010 7:10 pm Post subject: |
|
|
Hmm...
Posted code looks proper. Please doublecheck the "set reason" line. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Sun Feb 21, 2010 8:55 pm Post subject: |
|
|
| It looks the same as my code. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Feb 21, 2010 9:16 pm Post subject: |
|
|
Hmm... there is no other lrange command within the user_reason proc.. There is one within the maskhost proc posted by User in that other thread.
Do you think you could paste the whole script you've currently got, just to make sure no typos made it in there or such? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Sun Feb 21, 2010 9:52 pm Post subject: |
|
|
I'm using his original one with my script:
| Code: | # Setting:
set maskhostDefaultType 0
# The proc:
proc maskhost [list name [list type $maskhostDefaultType]] {
if {[scan $name {%[^!]!%[^@]@%s} nick user host]!=3} {
error "Usage: maskhost <nick!user@host> \[type\]"
}
if [string match {[3489]} $type] {
if [string match {*[0-9]} $host] {
set host [join [lrange [split $host .] 0 2] .].*
} elseif {[string match *.*.* $host]} {
set host *.[join [lrange [split $host .] end-1 end] .]
}
}
if [string match {[1368]} $type] {
set user *[string trimleft $user ~]
} elseif {[string match {[2479]} $type]} {
set user *
}
if [string match {[01234]} $type] {
set nick *
}
set name $nick!$user@$host |
Is this really necessary and is it the right one? I reloaded both scripts(separated them into two different files), and I got a new error: Tcl error [user_reason]: Usage: maskhost <nick!user@host> [type]
So.. does that mean... that I need to do: MODE $chan +b [maskhost $whom! 0]? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Feb 22, 2010 12:52 pm Post subject: |
|
|
Well, almost...
If you check closely, you'll see I use a slightly different commandline for the maskhost (in my previous post). It goes something like this:
| Code: | | ...[maskhost "$whom![getchanhost $whom chan]"]... |
maskhost expects nick!user@host, while getchanhost only returns the user@host part, the classic one manages without the nick-part (since it's never included in the mask anyway), however, given the setting of masktype, User's version needs the nick-part aswell... _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Mon Feb 22, 2010 11:40 pm Post subject: |
|
|
I ended up figuring it out last night. Had to change a few things, but it works now. Thanks for your help, appreciated. |
|
| Back to top |
|
 |
|