mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2021
Posts: 119
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 119
Greetings folks,

i have been using this alias for a while and it works fine for searching for nicks in channel with wildcard * as well but when i try with ??? (to search for nick length) it doesnt seem to trigger.

Here is what we work with :

Code

NSearch {
  if ($active !ischan) { echo -stac own This command can only be used on a channel. | halt }
  if (!$1) { echo -a *********** no valid entry was given ************* Syntax : /nsearch som*nick | halt }  
  var %o,%counter,%i = 1
  while ($nick($active,%i,a)) {
    if ( $1 iswm $v1) {
      %o = $addtok(%o,$v2,32)
    }
    inc %i
  }
  if (%o) {
    while %o {
      echo $active $gettok(%o,1-50,32)
      %o = $deltok(%o,1-50,32)
      inc %counter 50
    }
  }
}


Joined: Nov 2021
Posts: 119
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 119
ive edited it and this seems to work as expected incase someome needs it as well :

Code

NSearch {
  if ($active !ischan) { echo -stac own This command can only be used on a channel. | halt }
  if (!$1) { echo -a *********** no valid entry was given ************* Syntax : /nsearch som*nick or /nsearch som??*nick | halt }  
  var %o,%counter,%i = 1
  while ($nick($active,%i,a)) {
    var %nicks $v1
    if ( $1 == ? && $len( %nicks ) >= $len($1)) {   %o = $addtok(%o,$v2,32) }
    if ( $1 iswm %nicks ) {  %o = $addtok(%o,$v2,32) }
    inc %i
  }
  if (%o) {
    while %o {
      echo $active $gettok(%o,1-50,32)
      %o = $deltok(%o,1-50,32)
      inc %counter 50
    }
  }
}



Link Copied to Clipboard