here is another, I think this is alot better since I dont like %var's

Code:
on 1:JOIN:#:{
  if ($me isop #) {
    if (%Voice.Count == $null) { inc %Voice.Count 1 | mode # +v $nick }
    if (%Voice.Count < 5) { inc %Voice.Count 1 | mode # +v $nick }
    set -u5 %Voice.Count %Voice.Count
}

This section is just the script that autovoices users on join, the %var is a flood protection so you dont flood off when massive netsplits occurs (when the resynchs)
If you dont use this kind of protection, you will flood off, the script basically on voice 5 users on mass joins, then it stops.

Code:
On *:voice:#:{
  if ($nick == $me) {  
    var %voiced $readini(voice.ini,voices,voiced)
    if (%voiced == $null) { writeini voice.ini voices voiced 1 }
    if (%voiced != $null) { inc %voiced 1 }
    if (%voiced > $readini(voice.ini,voices,voiced)) { writeini voice.ini voices voiced %voiced }
  }
  var %allvoiced $readini(voice.ini,voices,allvoiced)
  if (%allvoiced == $null) { writeini voice.ini voices allvoiced 1 }
  if (%allvoiced != $null) { inc %allvoiced 1 }
  if (%allvoiced > $readini(voice.ini,voices,allvoiced)) { writeini voice.ini voices allvoiced %allvoiced }
}

This part counts all the voices made in channels, and writes them to a file, so incase your mirc is closed inproperly, the latest count is saved (mirc doesnt write %variables on the fly, only on proper exit/quit)
What it does is basically, it sets a temp %var from the data it reads $mircdir\voice.ini, and then adds the new voice tho the %var, then it writes the new count back to the file.
You can ofcuz change it to only watch 1 channel, add -v+o-o+b-b and kicks too. and you can move the file from $mircdir and name it what you want.

Code:
alias voicereset {
  writeini voice.ini voices voicedate $$?="Enter The Date"
  writeini voice.ini voices voiced 0
  writeini voice.ini voices allvoiced 0
  echo -a  $+ $color(own) -x 2,15 Counter Successfully Reset 
}

This is just to initilize the script/reset the counts and date.

Code:
alias voiced {
  if $readini(voice.ini,voices,voicedate) == $null {
    echo -a  $+ $color(own) -x 2,15 Script Halted, You havent set any date. 
    echo -a  $+ $color(own) -x 2,15 Starting voice script setup. 
    echo -a  $+ $color(own) -x 2,15 After setup run the script again. 
    .timer 1 3 voicereset
  }
  else say  I have Voiced: $readini(voice.ini,voices,voiced)  of  $readini(voice.ini,voices,allvoiced) 
}

usage /voiced :tongue:


-Peace