When Someone Deop You, With This Snippet You Can Automatically Reop.
&
When Some one Ban You, With This Snippet You Can Automatically Unban. <<Reop When Deoped>>
on 1:DEOP:#chan:{
if ($opnick == $me) {
cs op $chan
}
}
<<Unban when Ban>>
on @1:BAN:#chan:{
if ($banmask iswm $ial($me)) {
mode $chan -b $banmask
}
}
For clarification, Jethro_, since it retrieves the last token in a list with : between, if the server has no *:* bans it will still get the wildcard correctly. :)
It's indeed chr 58 for colon. You're correct on the obvious if a so called special ban is set as mentioned. However, not all the chat networks support the special bans. People who know of MSL should be capable of tweaking it to their liking based on their network protocols. ^^
It won't match if they place a special ban like ~q: though, so for that you could use ($gettok($2,-1,58) iswm $ial($me))
I think a colon is 58, anyway. Not checking now.
That regex is to match the mode +b, (we don't want it to trigger upon -b so it has to be negated using the ^ sign) where $2 is the string of nick or ident banned under the rawmode event. In this case, we want to watch out for someone who sets a ban on the client that runs the code. The $ial($me) returns the whole address from the internal address list, sort of like $fulladdress or $address($2,5). The iswm operator is used so we can match it as a wildcard string. Once a ban is set on the client, the code will immediate get the ban unset. It doesn't matter if it's a nick, ident or host ban. The code will reverse the action.