Just a couple of ideas I thought to add to the discussion.
on $*:TEXT:/^startlog (#\S+)$/iS:?:{
if (!$istok(%rootn %rootn2,$nick, 32)) {
.notice $nick Permission denied.
}
else {
set %log 1
set %lchan $regml(1)
.notice $nick Now logging %lchan
}
}
Or:
//auser rootn %rootn | auser rootn %rootn2
on $rootn:TEXT:/^startlog (#\S+)$/iS:?:{
set %log 1
set %lchan $regml(1)
.notice $nick Now logging %lchan
}
on $*:TEXT:/^startlog (#\S+)$/iS:?: .notice $nick Permission denied.
While the final colon is not required, getting into the practice of omitting it will eventually cause you problems you won't be able to track down. And THAT is a true statement, just as omitting the = after /var will eventually bite you as well and be very hard to troubleshoot. Get into the habit of following standard coding practices in whatever environment you find yourself and you'll save much time down the road in troubleshooting to make it well worth your time investment.
You alter from the standard only when you have a specific reason to do so, not just because you can get away with it (for now). For instance, while using command separators (|) and writing all your commands on a single line is faster to process, it is also harder to read and therefore troubleshoot, especially when there are multiply nested code blocks. In this instance, you have to ask yourself if speed is really an issue or not: Will this code be executed so often that the decrease in maintainability be worth the small speed increase gained? Most often, it won't be worth it; sometimes, it is very necessary. So, unless you have a specific reason for varying from the standard, write your code (basically) the same way everyone else does. This also makes it easier for others to give you assistance when you need help.