this seems to work well for me maroon helped me get it to work


Code
alias IdleDevoice {
  var %exemptions = chanserv $me Hawk
  var %c = $iif($1 ischan,$1,$active) , %i = 1
  while ($nick(%c,%i,v,oh).pnick) {
    var %pnick $v1 , %nick $nick(%c,%i,v,oh) , %umode $replace($remove(%pnick,%nick),+,v)

    if (!$istok(%exemptions,%nick,32) && $nick(%c,%nick).idle >= 1200) { var  %unset = %unset $+ %umode , %params = %params $str(%nick $+ $chr(32),$len(%umode)) }
    inc %i
  }

  if (%unset && %params)  { pushmodex  %c - $+ %unset %params  }
}



the pushmodex you can get online not sure if its allowed to use url here but the pushmodex helps to compress the mode settings if u need to push out multiple devoices in 1 go without spamming the channel withj multiple lines