I got this one now;

Quote:
on *:join:#: {
if (%autovoice == $chan on) { mode # +v $nick }
else { halt }
}
on 1000:text:.av *:#: {
if ($2 == on) { set %autovoice $chan on | notice $nick Done. }
elseif ($2 == off) { set %autovoice $chan off | notice $nick Done. }
}