basically for a bot. it locks and unlocks your channel
on 1000:text:!private*:#:{ if ($nick isop $chan) || ($nick ishop $chan) {
/mode $chan +m
/mode $chan +p
/mode $chan +i
/mode $chan +N
/mode $chan +C
/mode $chan +k 010100100PRIVATE01001010
/msg $chan Channel $chan is now Locked
}
}
on 1000:text:!public*:#:{ if ($nick isop $chan) || ($nick ishop $chan) {
/mode $chan -m
/mode $chan -p
/mode $chan -i
/mode $chan -N
/mode $chan -C
/mode $chan -k 010100100PRIVATE01001010
/msg $chan Channel $chan is now Unlocked
}
}
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.