ok, i will tell you excactly what i want to do. Thanks to RusselB i have a perfect code for a 'bot add/del a user from adressbooks voice list. ( THANKS RUSSELB!!!).

The code i have is:

Code:
 on @*:text:!vlist*:#:{
  if ($nick isop #) {
    if (!$2) {
      var %a = 1
      while %a <= $voice(0) {
        .write voice.tmp $gettok($avoice(%a),1,33)
        inc %a
      }
      .play $chan voice.tmp
      .remove voice.tmp
      set %voiced $sorttok(%voiced,44)
      set %voiced $replace(%voiced,$chr(44),$+($chr(44),$chr(32)))
      .msg $nick %voiced
      unset %voiced
    }
    elseif ($2 == add) {
      if (!$3) {        msg $chan $nick text here      } 
           else {
        var %a = 1
        while %a <= $numtok($3-,32) {
          var %nick = $gettok($3-,%a,32)
          var %address = $gettok($address(%nick,9),1,46)
          if (%nick !ison $chan) {            msg $chan Sorry, but %nick must be on $chan in order to add them          }
          elseif $avoice(%address) {          msg $chan %nick is already in the auto voice list        }
          else {
            set %avoice $addtok(%avoice,%nick,32)
            .avoice %nick $chan
            msg $chan %nick has been added to the auto voice list
            if $numtok(%avoice,32) = $modespl {
              unset %avoice
            }
          }
          inc %a
        }
        if %avoice {
          unset %avoice
        }
      }
    }
    elseif ($2 == del) {
      if (!$3) {        msg $chan $nick text here      }
      else {
        var %a = 1
        while %a <= $numtok($3-,32) {
          var %nick = $gettok($3-,%a,32)
          var %address = $gettok($address(%nick,9),1,46)
          if (%nick !ison $chan) {            msg $chan Sorry, but %nick must be on $chan in order to delete them          }
          elseif !$avoice(%address) {          msg $chan %nick isn't on the auto voice list        }
          else {
            set %avoice $addtok(%avoice,%nick,32)
            .avoice -r %nick $chan
            msg $chan %nick has been deleted from the auto voice list
            if $numtok(%avoice,32) = $modespl {
              unset %avoice
            }
          }
          inc %a
        }
        if %avoice {
          unset %avoice
        }
      }
    }
    else {      msg $chan Valid commands are !vlist add <nick(s)>, !vlist del <nick(s)>.      }
  }
}
else {
  msg $nick Sorry, this command is for opers in $chan only
}
}  



ok! the thing that i want to do is: if someone go to add a nick to the voicelist and this nick is unregistered, to dont add the nick to the voicelist and say 'sorry, nick is a unregistered nick, you cant add it to the voicelist.

Last edited by problematic; 19/09/05 05:43 PM.