proc my:bad:join {nick uhost handle channel} {
if {![file exists $::badfile]} {
putlog "Error: $::badfile dose not exist."
return 0
}
if {![botisop $channel]} {
return
}
if {$nick == $::botnick} {
foreach luser [chanlist $channel] {
if {$luser == $::botnick} {
continue
}
set file [open "$::badfile" r]
while {![eof $file]} {
set line [gets $file]
if {![string match "$uhost" "$line"]} {
set mask "*!*@[lindex [split $uhost @] 1]"
newchanban $channel $mask BadJoin "$::badreas" $::badtime
}
}
catch {close $file}
}
return
}
set file [open "$::badfile" r]
while {![eof $file]} {
set lines [gets $file]
foreach line $lines {
if {$line == ""} {
continue
}
set mask "*!*@[lindex [split $uhost @] 1]"
putlog "$mask vs. $line"
if {[string match "$mask" "$line"] || [string equal "$mask" "$line"]} {
return
}
set mask "*!*@[lindex [split $uhost @] 1]"
# newchanban $channel $mask BadJoin "$::badreas" $::badtime
putserv "PRIVMSG $channel :banning $nick with $mask"
}
}
catch {close $file}
}
When I have in list this masks *!*@somehting.com *!*@bla.com *!*@I.Have.Killed.The.Devil.So.God.Made.Me.An.Angel.org he "bans" me no matter if I have the *!*@I.Have.Killed.The.Devil.So.God.Made.Me.An.Angel.org hostmask. But if *!*@I.Have.Killed.The.Devil.So.God.Made.Me.An.Angel.org is the first mask in the list he dosen't ban me anymore. Any sugestions on what may be wrong in here?
Once the game is over, the king and the pawn go back in the same box.
1. Thanks for the loop vs. foreach tip. Removed it.
2. Added the -nocase and no result. Same story..
3. Removed it. Added the first one just to see the $mask vs. $line result.
I see it comparing: *!*@I.Have.Killed.The.Devil.So.God.Made.Me.An.Angel.org vs. *!*@I.Have.Killed.The.Devil.So.God.Made.Me.An.Angel.org and should return but it dosen't..
Once the game is over, the king and the pawn go back in the same box.
well, just a single space at the end of *!*@I.Have.Killed.The.Devil.So.God.Made.Me.An.Angel.org will make it return 0, just add another vildcard to the match, like this:
Nope. Same result..
on dcc:
(13:27:12) ::: <bot> [13:27] *!*@I.Have.Killed.The.Devil.So.God.Made.Me.An.Angel.org vs. *!*@I.Have.Killed.The.Devil.So.God.Made.Me.An.Angel.org
on channel:
(13:27:13) ::: <@bot> banning caesar with *!*@I.Have.Killed.The.Devil.So.God.Made.Me.An.Angel.org
Once the game is over, the king and the pawn go back in the same box.