Project

General

Profile

Content Filtering

Added by Snork Asaurus almost 10 years ago

Greetings,

Is there a way to do rule based content filtering in AdiIRC? For example:

- if channel = #funchan & nick = badnick & text contains badword then suppress message
- if text contains naughtyword or othernaughtyword then suppress message
- if text contains dirtyword and nick != mynick then suppress message

It seems to me that scripting is able to "react" to messages, but is not actually able to drop them entirely (or at least not display them)... or am I missing something?

Thanks,
S.


Replies (7)

RE: Content Filtering - Added by Per Amundsen almost 10 years ago

you can use the on TEXT event, example

on ^*:TEXT:#:*:{
  if ($chan == #mychan && $nick == badnick && $1- iswm *badword*) {
    ; halt means stop AdiIRC from showing this text
    halt
  }
}

You can also use some of the parameters of the event to only react on certain channels and words, you can read more about that at http://en.wikichip.org/wiki/mirc/on_event

Fixed small typo

RE: Content Filtering - Added by Snork Asaurus almost 10 years ago

Hi PA,

Thanks for the incredibly fast reply! I tried a copy/paste of that script [with my channel and nick values] and was still not getting messages suppressed (even after your typo repair). I did some fiddling and decided to trim it to just the nick test and found that

1. Using "^*:TEXT:#:*:" did not trigger the rule for me, but "*:TEXT:*:*:" did.
2. Using the following does give me a "booyeah" reply:

on *:TEXT:*:*:{
  if ($nick == snork) {
    /msg $chan booyeah
  }
}

3. However, switching "/msg $chan booyeah" to "halt" does not suppress messages from snork.
4. If I use the following it does not give me a "booyeah" reply:
on *:TEXT:*:*:{
  if ($nick == snork) {
    halt
    /msg $chan booyeah
  }
}

... but messages from snork still appear.

The halt command does seem to be stopping execution of any further commands within the script but does not stop the original message from appearing in the chat window. I admit that my scripting skills are minimal, am I perhaps misunderstanding something?

Thanks,
S.

RE: Content Filtering - Added by Per Amundsen almost 10 years ago

They only work for incoming messages, not you're own.

RE: Content Filtering - Added by Per Amundsen almost 10 years ago

^:TEXT:#:: the "#" means it will only trigger if a channel, "*" means it will trigger in any window.

RE: Content Filtering - Added by Per Amundsen almost 10 years ago

Also remember the ^ in front of on TEXT so it becomes "on ^:TEXT"

The ^ means haltable event.

RE: Content Filtering - Added by Per Amundsen almost 10 years ago

Sorry I made an error in my first example.

on ^*:TEXT:*:#:{
  if ($chan == #mychan && $nick == badnick && $1- iswm *badword*) {
    ; halt means stop AdiIRC from showing this text
    halt
  }
}

<marchtext> comes before <target>.

RE: Content Filtering - Added by Snork Asaurus almost 10 years ago

Sweet! I made a couple of small changes and it seems to be working perfectly now with this:

on ^*:TEXT:*:#:{
  if ($chan == #mychan && badnick* iswm $nick && *badword* iswm $1-) {
    halt
  }
}

I changed the evaluation of nick to "badnick* iswm $nick" so that it would still catch "away nicks" such as "badnick_" and I found that I had to switch the values of the badword evaluation around as it seems to only check from left to right. Thanks for your help, much appreciated!

S.

    (1-7/7)