mIRC Homepage
Posted By: EasyObserver Ban via real name field?? - 07/11/14 03:15 AM
Hi..is there a way for mIRC to "read" the real name field of a user joining a channel, and act on the results of it's findings? The reason I'm asking is because we are being spammed quite frequently but the user always changes his host/IP, however, his real name field is always the same, so if I could find a way to ban based on their real name it would be a huge accomplishment.
Posted By: westor Re: Ban via real name field?? - 07/11/14 01:06 PM
It depend on the IRC Server ircd - irc services. it's better to ask on the help support room of the server that you are using try use: /list help or join into #Help (not sure) and ask there.
Posted By: Wims Re: Ban via real name field?? - 07/11/14 01:48 PM
Are you sure you're not talking about the ident part?
You can't ban on the realname, it's not part of an address/host, you could ban the address depending on the realname but that wouldn't prevent that user from joining again if his host/ip, there is basically nothing that can be done to someone changing is host/ip, he is just a new user,
Posted By: Masoud Re: Ban via real name field?? - 07/11/14 02:48 PM
@Wims: You can ban the realname on UnrealIRCd.
Code:
/mode #chan +b ~r:Realname


@EasyObserver: I've written something for this before, maybe you could use it.
Code:
menu Channel,Nicklist,Menubar,Status {
  -
  Real name Checker
  .$iif($timer(.Recheck),$style(1)) Enable:.timer.Recheck $iif($timer(.Recheck),off,1 %RN.Delay GetName.Checker)
  .-
  .Set Real names:set %RN.Check $$input(Separated by semi-colon,e,Real name checker,%RN.Check)
  .Exception?:var %ex = $$input(Separated by semi-colon,e,Exception list,%RN.Exception) | $iif(%ex != $null,set,unset) %RN.Exception %ex
  .-
  .Set Delay $+($chr(40),$iif(%RN.Delay != $null,every $v1 $+ s,Not set yet),$chr(41)):set %RN.Delay $$?="Enter a number from 1 to 60"
  .-
  .$iif(%RN.Wise == 1,$style(1)) Use Wise Method:set %RN.Wise $iif(%RN.Wise == 1,0,1) | unset %RN.Last
  -
}

on !@*:Join:#:{ GetName $nick }

alias -l GetName {
  if ($1) && ($timer(.Recheck)) {
    if (!$hget(GetName)) { hmake GetName }
    if (!$hget(GetName,$1)) { hadd -m GetName $1 !@! }
  }
}

alias GetName.Checker {
  if (%RN.Delay == $null) { set %RN.Delay 1 }
  if (%RN.Wise == 1) && (%RN.Last != $null) goto Jump
  var %x = 1
  while ($hget(GetName,%x).item) {
    var %item = $hget(GetName,%x).item
    if ($hget(GetName,%item) == !@!) {
      .enable #WhoisHalt
      set %RN.Last -u60 %item
      !whois %item %item
      break
    }
    inc %x
  }
  :Jump
  .timer.Recheck 1 %RN.Delay GetName.Checker
}

alias -l TakeAction {
  if ($1) {
    var %x = $hget(GetName,$1)
    if ($wildtok(%RN.Check,%x,0,59)) { 
      if ($wildtok(%RN.Exception,%x,0,59)) goto Jump
      var %i = 1
      while ($comchan($1,%i)) { ban -k $v1 $1 2 You're not welcome! | inc %i }
      :Jump
      hdel GetName $1
      unset %RN.Last
    }
  }
}

#WhoisHalt off
raw *:*:{
  if ($istok(307 310 311 312 313 317 318 319 330 338 379 378 318 401,$numeric,32)) haltdef
  if ($numeric == 311) { hadd -m GetName $2 $strip($6-) | TakeAction $2 }
  elseif ($numeric == 318) { .disable #WhoisHalt }
  elseif ($numeric == 401) && ($hget(GetName,$2).item) { hdel GetName $2 }
}
#WhoisHalt end


I should mention that this kind of ban totally depends on the IRCd that the target server is running. This will only work on UnrealIRCd based networks.
(Although this code can be used on any IRCd, since it doesn't use ~r:. It just checks for realname that you specified in its settings using /whois.)
Posted By: Wims Re: Ban via real name field?? - 07/11/14 03:20 PM
Right! Didn't know about this, then it's indeed depending on the ircd used
Posted By: westor Re: Ban via real name field?? - 07/11/14 05:26 PM
I told you that before that it depends on the ircd above blush
Posted By: EasyObserver Re: Ban via real name field?? - 08/11/14 01:54 AM
Thanks very much, I have a guy looking at it to see if we can get it working on Undernet.
Posted By: EasyObserver Re: Ban via real name field?? - 08/11/14 02:42 AM
No..not the ident or host/IP, I know how to ban using those. We just have this guy that keeps joining and spouting racial slurs using different idents, host/IP's but the real name field is always the same.
Posted By: EasyObserver Re: Ban via real name field?? - 08/11/14 02:44 AM
So far not having much luck getting it running on Undernet. I know this may sound like a stupid question..but did you write it for mIRC or was it written for a different client?
Posted By: Masoud Re: Ban via real name field?? - 08/11/14 12:14 PM
It's an mSL code. and you need to configure it first. (Right click on Channel/Nicklist/Status window...)
Posted By: EasyObserver Re: Ban via real name field?? - 25/12/14 07:44 PM
Masoud...my apologies, I forgot to thank you and let you know that we got this script working on Undernet and it works like a charm...just took a little bit of work by a good friend of mine. Thanks very much for giving us the insight to what we were looking for, much appreciated.
Posted By: Masoud Re: Ban via real name field?? - 26/12/14 04:06 PM
No problem,
You're very welcome.
Posted By: EvilHeart Re: Ban via real name field?? - 21/03/18 05:12 PM
i need modify this script

nick and real name if found script ban him
Posted By: Raccoon Re: Ban via real name field?? - 21/03/18 09:36 PM
[Notice: Thread resurrection from >3 years ago]

Hello EvilHeart. You'll be glad to know that as of several months ago, the ability to do this has been made easier, but how you accomplish it will depend on the network server you are on and which features they support.

Some networks support a form of EXTBAN which may allow for direct banning of a gecos. Freenode allows this via $r:gecos?goes?here and $x:*!*@*#gecos?goes?here ban masks.

Alternately, you can write a script that loops through each $nick(#chan,%i) and examines $ial(%nick).gecos for a matching pattern, banning that $address(%nick,N) when a match is found.

In order for $ial(%nick).gecos to work, a /ialfill #chan must have been performed at least once since you joined, AND, the server must either support CAP extended-join or you must manually perform a /who $nick on each person as they join the channel (expensive). So your results will vary depending on the network capabilities.

It's pretty straight forward from here, so I'll leave you to the actual task of scripting it so you may achieve a sense of accomplishment.
© mIRC Discussion Forums