BanSearch

By SyntaxIRC on Jul 02, 2007

This alias will find all bans matching whatever you search for, for example;

/sb *.net would search for all addresses on the ban list ending with .net and return them in the channel.

The newer version, which will be released in a few weeks (busy) will contain a dialog.

alias sb {
  if ($active !ischan) {
    echo 4 $active Error: You are not on a channel.
  }
  if (!$1) {
    echo 4 $active $+(4Banlist Size,$chr(32),$chr(40),$ibl($active,0),$chr(41))
    halt
  }
  var %i = $1
  var %d = $ibl($active,0)
  var %o = 1
  while (%o <= %d) {
    if (%i iswm $ibl($active,%o)) {
      write wmsb.txt $+(4,[,$iif($lines(wmsb.txt) < 1, 1, $calc($lines(wmsb.txt) +1)),],) Matched string $+(,$chr(40),$1,$chr(41),) - $ibl($active,%o)
    }
    inc %o
  }
  echo 4 $+(4,$lines(wmsb.txt)) results found for string $+(%i,.)
  .play -e wmsb.txt
  .write -c wmsb.txt
}

Comments

Sign in to comment.
Lindrian   -  Jul 02, 2007

Also, sorry for another post, but you can query someone with # in their nickname. So yet I sugges !ischan for this.

 Respond  
Lindrian   -  Jul 02, 2007

I used it right, and it still returned an error.

 Respond  
SyntaxIRC   -  Jul 02, 2007

Anywho, it\'d still be a working alias if you use it right.

 Respond  
Lindrian   -  Jul 02, 2007
  if ($chr(35) !isin $active) {
    echo 4 $active Error: No are not on a channel.
  }

Use:

if ($active !ischan) {

also,

echo -a, instead of echo $active.

also:

you dont need the \"halt\" here:

  if (!$1) {
    echo 4 $active $+(4Banlist Size,$chr(32),$chr(40),$ibl($active,0),$chr(41))
    halt
  }

this is what you use:

  var %i = $1
  var %d = $ibl($active,0)
  var %o = 1
  while (%o <= %d) {
    if (%i iswm $ibl($active,%o)) {
      write wmsb.txt $+(4,[,$iif($lines(wmsb.txt) < 1, 1, $calc($lines(wmsb.txt) +1)),],) Matched string $+(,$chr(40),$1,$chr(41),) - $ibl($active,%o)
    }
    inc %o
  }
  echo 4 $+(4,$lines(wmsb.txt)) results found for string $+(%i,.)
  .play -e wmsb.txt
  .write -c wmsb.txt
}

I would use:

alias sb {
  if ($active !ischan) { echo -a Error: No are not on a channel. | return }
  if (!$1) { echo -a $+(4Banlist Size,$chr(32),$chr(40),$ibl($active,0),$chr(41)) | return }
  ; Using proper if format for the IF\'s above.
  updatenl
  ; update the ban list
  var %i = $1, %d = $ibl($active,0), %o = 1, %x, %y = $active
  ; using 1 line for all temp. vars.
  while (%o <= %d) {
    if (%i iswm $ibl($active,%o)) {
      %x = %x $v2
      var %a = $ibl(%y,%o).by, %b = $asctime($ibl(%y,%o).ctime)
      ; Set the values for the result
    }
    inc %o
  }
  echo -a $numtok(%x,32) results found for string $qt(%i)
  ; $numtok() shows how many tokens %x contains.
  if ($numtok(%x,32) != 0) echo -a %x matched %i set by %a at %b
  ; checks to $numtok is not 0.
}

Note that my code above is untested, but it should do what you want, without using the text file.

Your script resulted * /play: unable to open \'C:\Regularmirc\wmsb.txt\' (line 58, script.ini) when no matches were found. Anyhow, this script above you be fine. No color codes though ;p

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.