You wrote
( $COguy !isop $chan ). %COguy isn't an identifier, it's a variable
Here's somewhat shorter version of your code:
alias CO {
var %total = $nick(#,0), %counter = 1
while (%counter <= %total) {
var %nick = $nick(#,%counter)
if ($level($address(%nick,5)) == %OL) && (%nick !isop #) {
.notice %nick 0,2 %myname 15<=>0 To Sub-Ops 15=]2,0 $1- 15,2[=
Echo -a 0,2 Sent 15<=>0 To %nick 15=]2,0 $1- 15,2[=
}
inc %counter
}
}
- Used local variables instead of global ones
- Used address type of 5 (instead of 1), that returns full address.
- Moved /inc outside of the if statement.
- Also, /unset can unset several variables in one command, eg:
/unset %1 %2. Anyway, since the code above uses local variables, it's not needed here.
- Should %myname represent your nick? if so, you can use $me.