on @hoppers:TEXT:!dehalfop *:#the_british_legion: {
if (($nick isreg $chan || $nick isvoice $chan )) { halt }
msg $chan mode $chan -h $$2
}
on @hoppers:TEXT:!halfop *:#the_british_legion: {
if (($nick isreg $chan || $nick isvoice $chan )) { halt }
msg $chan mode $chan +h $$2
}
* The @ prefix means you must be opped.
* The 'hoppers' user level is the level to which to add people you wish to be able to use these commands (Safer than allowing anyone to use it) (see "/help /auser" for adding users to levels, and "/help user levels" for general info)
** This means that the 'halt' line may not be necessary...
* The '*' in the matchtext matches anything (including nothing) after the command.
* The target is now channel-specific. You could add others, separating them with commas. (Safer than enabling it for all channels)
* You don't need '/'s in scripts.
* $chan will only ever be whatever channel the target triggered for (#the_british_legion, here)
* $$2 - the two $s mean that the script will halt if there was no parameter to the command. (i.e. someone typed in just "!halfop")
[edit]
P.S. I left the msg $chan in for testing; I assume you realised that you needed to remove it to get the mode command to work... Personally I would prefer a echo $chan, but I guess this is on a bot...)
[/edit]