mok: It's because AaronL originally asked for script that checks only complete words. If you want my script to work with "bad words" that are linked to other words, replace the line:

if ($istok($1-,$gettok(%bad_word_list,%i,32),32)) {

with this:

if ($gettok(%bad_word_list,%i,32) isin $1-) {

Now you can have # in the %bad_word_list and it'll be handled as swearing no matter where it appears in the message. Even good guys will get swear warnings if they happen to have # somewhere.

This kind of automatic tests cannot be 100 % reliable. If you want every word that even distantly looks like "bad" being count as swearing, it's probable that innocent messages will get counted as well. It is possible to make a script which checks every single word being sent if they match to certain wildcard text (for example *badword* or #???abcd* ...) but it takes time to run such tests and mIRC might slow down seriously (at least on my VERY old computer).

If you're interested in developing more accurate word tests, try counting how many words there are in the message by $numtok($1-,32) and looping (/help /while) a test for every word. In actual test you can use ISWM operator instead of ISIN and it'll allow you to use wildcard words in %bad_word_list variable (see "/help if then else" for more info on operators).

Hope this helps.