" .Auto Ops
..Auto Ops %auto.op:{
if ( %auto.op == ON ) { set %auto.op OFF
/.auto OFF
/echo 1 »14»15» 12 Auto Ops 4OFF.... }
else { set %auto.op ON
/.auto ON
/echo 1 »14»15» 12 Auto Ops 4ON.... }
}
..Add Auto Op for $$1 on $chan
..Add Auto Op for $$1 on all channels:{
.ruser $$1 5
/auto $$1 # 1
/echo 1 »14»15» 4 $$1 12has been added to Auto-Op
/.notice $$1 You have been added to my Auto-Ops.
/mode # +o $$1
} "

you really dont need all this: mirc does have a built in auto op / voice and protect

" /aop [-rw] <on|off|nick/address> [#channel1,#channel2,...] [type] [network] " From Help aop

this is how i have mine set:
you do have to make sure that you have set your mirc to allow auto oping ect. alt + b then control tab change drop down box to op click enabled then do the same for voice and protect.
Auto - Ops/Voice:
.Auto Ops
..Give: { aop -w $$1 2 # }
..Take: { aop -rw $$1 2 # }
.Auto Voice
..Give: { avoice -w $$1 2 # }
..Take: { avoice -rw $$1 2 # }
.Protect
..Give: { protect -w $$1 2 # }
..Take: { protect -w $$1 2 # }

hope that helps you out
~ - SnowBlind