why not just shorten the line
if (($nick($chan,%i) isop $chan) || ($nick($chan,%i) isvoice $chan) || ($nick($chan,%i) ishop $chan)) {
if ($nick($chan,%i) != $me) { .notice $nick($chan,%i) [@] $1- }
to this
if ($nick(#,%i) != $me && $nick(#,%i) !isreg #) .notice $nick(#,%i) [@] $1-
so the code would look like this
alias ohv {
var %a = $nick(#,0), %i = 0
while (%i <= %a) {
inc %i
if ($nick(#,%i) != $me && $nick(#,%i) !isreg #) .notice $nick(#,%i) [@] $1-
}
echo 4 # [OHV] $1-
}
also you can do something like this as well making it to notice by useing usermodes like ~ & @ % + so to notice say halfops you would do
/modenotice % message here
alias modenotice {
if ($regex($1,/^[~@&%+]$/)) {
var %a = $nick(#,0), %i = 0
while (%i <= %a) {
inc %i
if ($nick(#,%i).pnick != $me && $left($nick(#,%i).pnick,1) == $1) .notice $nick(#,%i) $+($chr(91),$1,$chr(93)) $2-
}
echo 4 # $+($chr(91),$1,$chr(93)) $2-
}
}