just thought id show another way, it only works for blocking in total, not per nick, but makes ya code look real complexe
It also isnt defeated by color codes etc
On *:Text:$($iif(($+(%example.blocker,!example) == $strip($1-)),$1-)):#channel: {
set -su10 %example.blocker $cr
msg $chan This is an example.
}
Since you cant send $cr $+ !example if %example.blocker still exists the $1- can never match it, thus the $iif fails and there is no match string.
$cr could also have been ctrl-k (aka ctrl-c) ctrl-r or ctrl-u as the strip removes them
That was just a little add on to what i have been using lately for getting around color codes which was where that method originated from
say you have
on *:text:
!blah *:{ ... }
on *:text:
!blob *:{ ... }
if you have to deal with bold/underlines/reverse & colorized text, you can do this
on *:text:& *:#channel: {
tokenize 32 $strip($1-)
if ([color:blue]!blah *[/color] iswm $1-) { ... }
elseif ([color:blue]!blob *[/color] iswm $1-) { ... }
}
but as we all know that then sucks up all the ON TEXT events
these well just attract the wanted event, and no others (ignoring BURKO codes)
on *:text:$($iif((
!blah * iswm $strip($1-)),$1-)):#channel: { ... }
on *:text:$($iif((
!blob * iswm $strip($1-)),$1-)):#channel: { ... }
Im sure some regex guru might be able to show me one that does that also, but i couldnt work one out, no matter how hard i tried.
I would have loved if you could have made it $nick and $chan specific, but nether of them have any value inside that $( )
so you cant check against specifci user flags like $($+(%,block.,$nick),2) which is a shame. I might go make that as a suggestion now.