mIRC Homepage

mode +a and -a

Posted By: TECO

mode +a and -a - 20/06/20 05:40 PM

Hi guys
I'm here with a little problem.
I have this code:
Code
on ^*:rawmode:#:{
  if ($nick == $me) && (a isincs $1) {
    var %a = 1
    while (%a <= $len($1)) {
      var %c = $mid($1,%a,2)
      if (%c == +a) { inc %stat.admin }
      elseif (%c == -a) { inc %stat.deadmin }
      inc %a
    }
  }

This code is used to account the nicknames to which I give or take out mode +a, but it only works with one nick. If it is in multi-nickname it only counts one in it.

Example:
Quote
TECO sets mode [+a James]


In the following example it does not work correctly:
Quote
TECO sets mode [-aa James mIRC]

Is there anyone who can help me solve this?
Thank you! wink
Posted By: TECO

Re: mode +a and -a - 21/06/20 01:50 AM

Hi guys
I found this solution. I found a code here in a forum, analyzed the structure, modified of my it and now do what I wanted.

Code
on ^*:rawmode:#:{
  if ($nick == $me) && (a isincs $1) {
    var %a = 1
    while (%a <= $len($1)) {
      var %c = $mid($1,%a,1)
      if (%c == +) { var %d = 1 }
      elseif (%c == -) { unset %d }
      if (%c === a) && ($gettok($2-,1-,32) != $me) {
        if (%d) { inc %stat.admin }
        else { inc %stat.deadmin }
      }
      inc %a
    }
  }
}
© 2020 mIRC Discussion Forums