mIRC Home    About    Download    Register    News    Help

Print Thread
#212180 13/05/09 04:26 PM
Joined: May 2009
Posts: 28
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: May 2009
Posts: 28
how to write auto alert code when someone swear in the room.. thanks

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
You need an "on text" event to process incoming text messages. Maybe you want to use an "on action" event as well.
Inside the event(s), you check the message for swearword matches, and in case of a match, you trigger your notification.

There's a *lot* of different matching methods one could use, and there's a lot of different ways to access a "list" of swearwords. I suggest you have a look at some of the many "badword kickers" arround - they give plenty of examples for matching methods, and for ways of storing/processing a word list. If you find a script you like, simply put your notification in place of the original "enforcing measure".

For the alert/notification there's a *lot* of options as well shocked
Here are some of them:
- echo the notification to the active window / to the status window
- echo the notification to a dedicated ("custom") window
- trigger a text baloon ($tip)
- open a small modeless dialog ("popup") with infos about the incident (and maybe with different "reactions" to choose from)
- beep / flash / play some soundfile
- ...

Joined: May 2009
Posts: 12
E
Pikka bird
Offline
Pikka bird
E
Joined: May 2009
Posts: 12
quick and dirty one I would do is a simple on:text command like:

on $*:TEXT:/^(kit|kitty|swearword|dirtyword)/Si:#:{
msg $nick Don't let me catch you saying that word again!
notice $nick We don't appreciate you using foul language in our channel
}


Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
The disadvantage of using regex in the on text event is that it could get really long if more foul words are added in the long run. But then again, it's a quick, easy way to look for a few profane ones.


Link Copied to Clipboard