mIRC Home    About    Download    Register    News    Help

Print Thread
mode +a and -a #267380 20/06/20 05:40 PM
Joined: Jul 2014
Posts: 182
TECO Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jul 2014
Posts: 182
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


TECO
irc.PTirc.org (Co-Admin)
Re: mode +a and -a [Re: TECO] #267383 21/06/20 01:50 AM
Joined: Jul 2014
Posts: 182
TECO Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jul 2014
Posts: 182
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
    }
  }
}


TECO
irc.PTirc.org (Co-Admin)