Basic AMSG Filter
Posted by mklaif
Friday, April 27, 2007
Description: Basic AMSG Filter.  One variable setting.

Script by: mklaif
Date: 4/27/07

alias amsg {
  var %channum = 1
  while (%channum <= $chan(0)) {
    if ($chan(%channum) == #mklaiff) {
      haltdef
    }
    else {
      msg $chan(%channum) $1-
    }
    inc %channum
  }
}

Location: Remote
Usage: /amsg <text>

The example above blocks #mklaiff from being messaged when /amsg is used.

If you want to add multiple channels to the filter, use an || within the if statement.

For example:

alias amsg {
  var %channum = 1
  while (%channum <= $chan(0)) {
    if ($chan(%channum) == #mklaiff || $chan(%channum) == #mklaifff) {
      haltdef
    }
    else {
      msg $chan(%channum) $1-
    }
    inc %channum
  }
}

I know Sky has made one using a %filter variable when you add a channel, but I like to keep my Variable section empty.
Hmm
Posted by Log1x
Wednesday, July 04, 2007 07:23am PDT
You could always do this through *.txt or even *.ini. It would be a lot cleaner and more professional.

Either way, it's working.

Nice script.
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world