auto unbans
on 1:Ban:#: { if ($banmask iswm $address($me,5)) { .cs unban $chan } }
on *:BAN:#: {
if ($me isop $chan) {
if ($banmask iswm $address($me,5)) {
inc %kcount
mode # -b $banmask
kick $chan $nick Nice try Jack@$$ - Noobs Pwnt: ( %kcount )
ban $chan $nick 3
}
}
}
I didn't mean trying to show off or anything; I was just trying to find an inventive way to go about the generic method of a snippet. This is a part of my learning experience.
phil24, if you despise regex, you'll never learn of its benefits for many coding situations. Regex is universal and recognized by many programming languages. So try to get acquainted with it and you might like it gradually.
Just a little experiment with the $mode(). This should work correctly to reverse the ban set upon the client running the code. Feel free to give me some pointers, jaytea:
on !@*:rawmode:#:{
if ($mode(1).ban == $+($me,!*@*)) {
mode # -b $v1
}
else {
var %x = 1
while ($mode(%x).ban) {
var %v1 = $v1
if ($istok($+($address($me,0),$chr(32),$&
$regsubex($str(.,9),/./g,$&
$+($chr(32),$address($me,\n)))),%v1,32)) {
mode # -b %v1
}
inc %x
}
}
}
er Jethro, $mode().ban generally returns a ban mask (not a nick) and cannot be equal to $me. also, why restrict the check to only $mode(1).ban while it's easily possible for $mode(2).ban, $mode(3).ban etc. to affect you? and solely checking for nick bans while letting other types of bans slip through? i don't understand the suggestion at all i'm afraid :P
ignoring the rest of the code, the method killerpit4e uses to detect self-affecting bans is simple, functional and absolutely fine. the only advantage to using rawmode and looping through $mode() is the ability to handle multiple self-affecting bans in one fell swoop.