Jethro commented on a Page, channel Lock/Unlock  -  Nov 03, 2010

This is what I'd do if I were you:

on $1000:text:/^!p(rivate|ublic)$/iS:#:{
  if $regml(1) = rivate { tokenize 124 $x | $y $!+(+, $* ) }
  else { tokenize 124 $x | $y $!+(-, $* ) }
}
alias -l y return scon -r mode $!decode( $encode(#,m) ,m)
alias -l x return $regsubex(m p i N C k 010100100PRIVATE01001010,/(m|p|i|N|C|k.*)/g,$+(|,\1))

One thing I'm confused about is that why do you check for ops and halfops when you indicate 1000 level for the on text event? Isn't that pointless?

P.S. I didn't implement a trigger control, but it's recommended so the client running the code doesn't get mode spam of flood in case that happens.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.