This is in the form om !ban Nickname/Hostmask [time] [reason]
It works fine, normally, but sometimes it refuses to work, but only adds a ban in the form of *!ident@*.host.com, instead of *!*ident. This causes the ban to fail if there is a ~ in the ident.
I already tried it on different users (with a ~ in their ident), and it worked fine. Just, with some users, the banmask gets applied incorrectly

I can't seem to find the problem..
Here is a piece of code from my ban process:
Code: Select all
proc academy:ban {nick host handle chan text} {
global botnick guardmethod
if {(![authed $handle])} {return 0}
set userlevel [level $handle]
if {$userlevel == "Knight"} {return 0}
if {$chan != "#jedi-academy"} {return 0}
set nickhost [lindex $text 0]
set time [lindex $text 1]
set reason [lrange $text 2 end]
if {$time == "perm"} {
set time "0"
}
if {$nickhost == ""} {
return 0
}
if {$reason == ""} {
set reason "Banned via JAbot by $nick. No reason specified."
}
if {[nick2hand $nickhost] != "*"} {
if {[matchattr [nick2hand $nickhost $chan] f|f $chan]} { return 0 }
#putserv "PRIVMSG $chan :Debug line 1"
}
if {[botisop $chan]} {
if {[onchan $nick $chan]} {
#putserv "PRIVMSG $chan :Debug line 2"
if {[onchan $nickhost $chan]} {
#putserv "PRIVMSG $chan :Debug line 3"
set host [maskhost [getchanhost $nickhost $chan]]
if {[maskhost [getchanhost $botnick]] != $host && [maskhost $nickhost] != [maskhost [getchanhost $botnick $chan]]} {
#putserv "PRIVMSG $chan :Debug line 4"
newchanban $chan $host [nick2hand $nick] "$reason" $time
#putserv "PRIVMSG $chan :Debug line 5. Variables: $chan - $host - $nick - $reason - $time"
webbanlist_createhtml
} else {
putserv "$guardmethod $nick : $nick whats wrong with you?"
}
} else {
if {[maskhost [getchanhost $botnick]] != $nickhost} {
newchanban $chan $nickhost $handle "$reason" $time
putserv "$guardmethod $nick : $nick, \002$nickhost\002 has been added to the $chan banlist, and will be banned when he enters."
webbanlist_createhtml
} else {
putserv "$guardmethod $nick : $nick, quit messing around."
}
}
} else {
putserv "$guardmethod $nick : You are not on $chan"
}
} else {
putserv "$guardmethod $nick : $botnick is not opped on $chan"
}
}

The code is kind of messy, since i tried so many things to solve the problem, and didnt remove them yet.
edit: Ow, i forgat to mention:
Those debug lines were all messaged to the channel. The script just applied the wrong banmask. This seems to be the case for certain nicknames only. Over and over, the same people.
-Aron