I have created a small script for you. Try to use it. All settings are made inside the alias "abrn_set".

Code
#####################################################################
#   Name: Anti Bad Realname v1.0
#   Author: Epic (epicnet@mail.ru, http://epicnet.ru)
#   Description: All nicks join the channel are checked for bad words in their real name.
#####################################################################

alias -l abrn_set {
  %abrn_work = yes
  %abrn_kick = yes
  %abrn_ban = yes
  %abrn_write = yes
  %abrn_path_bw = $scriptdir $+ badwords.txt
  %abrn_path_bl = $scriptdir $+ blacklist.txt
  %abrn_reason = There is a bad word in your real name: &word
  %abrn_chans = #test,#xpl
}
---------------------------------------------------------------------
on *:JOIN:*: abrn_set | if (%abrn_work == yes && $istok(%abrn_chans,$chan,44)) { .hadd -m abrn $nick $chan | .who $nick }
raw 352:*:{
  var %nick $6 | var %rname $9-
  if ($hget(abrn,%nick)) {
    var %chan $hget(abrn,%nick)
    if ($bwfind(%rname)) {
      var %bw $v1 | var %addr $address(%nick,2)
      if (%abrn_ban == yes) .mode %chan +b %addr
      if (%abrn_kick == yes) .kick %chan %nick $replace(%abrn_reason,&word,%bw)
      if (%abrn_write == yes) .write -i %abrn_path_bl $+(%nick,;,%addr,;,%rname)
    } | haltdef
  }
}
raw 315:*: if ($hget(abrn,$2)) { .hdel -sw abrn $2 | haltdef }
alias -l bwfind { var %f %abrn_path_bw | var %i 1 | while (%i <= $lines(%f)) { var %s $read(%f,%i) | if (%s isin $1-) return %s | inc %i } }

If you have any difficulties with the setup or you encounter some errors while working with the code, then leave your comments here.


🌐 https://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples