This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Ban kick for Realname

Help for those learning Tcl or writing their own scripts.
Post Reply
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Ban kick for Realname

Post by juanamores »

They could help me with a TCL to ban and kick RealNames?
I know I use the RAW number 311 and in the $ 6- would realname.

Example:
06:32 NiCK Información sobre el nick Morrison:
06:32 NiCK Estado: ACTIVO
06:32 NiCK Realname: ZNC - www.morrison.org

Desire to ban and kick my channel, all nicks which are realname: ZNC - www.morrison.org

Thanks
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

This is just a simple and untested method, but if you play around with it a bit you may make it even better.

Code: Select all

bind raw - 311 check:gecos
proc check:gecos {from keyword text} {
  if {![string match -nocase "*znc*morrison*" $text]} {return}
  # change this numeric to the number for the nickname of offending user (currently set to 4 for example)
  set nicktoban [lindex [split $text] 4]
  set hosttoban [getchanhost $nicktoban]
  # Please read the tcl-commands.doc file inside ~/eggdrop/doc to understand newban, and either set a lifetime or allow global-ban-time
  newban *!*$hosttoban $::botnick "This ZNC is unwanted in this channel."
}
Last edited by Get_A_Fix on Fri Jan 27, 2017 9:29 am, edited 1 time in total.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

Tcl error [check:gecos]: wrong # args: should be "set varName ?newValue?"

In reality, the nickname does not match the name of the ZNC, this ZNC is used for others nicks that NOT contain the words "www.morrison.org".

I need to ban and kick any nick to use as realname: ZNC - www.morrison.org

How I can do to check the realname of all joining nick?
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

juanamores wrote:
Get_A_Fix wrote:This is just a simple and untested method, but if you play around with it a bit you may make it even better.

Code: Select all

bind raw - 311 check:gecos
proc check:gecos {from keyword text} {
  if {![string match -nocase "*znc*morrison*" $text]} {return}
  # change this numeric to the number for the nickname of offending user (currently set to 4 for example)
  set nicktoban [lindex [split $text] 4]
  set hosttoban getchanhost $nicktoban
  # Please read the tcl-commands.doc file inside ~/eggdrop/doc to understand newban, and either set a lifetime or allow global-ban-time
  newban *!*$hosttoban $::botnick "This ZNC is unwanted in this channel."
}
Solved, thanks :D
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

Great, glad you got it working.

Yes, I understood what you wanted, but because I used getchanhost, I needed to use the nickname, which is also returned by raw 311.

The code part..

Code: Select all

if {![string match -nocase "*znc*morrison*" $text]} {return}
would ONLY match those nicknames/joins that use the realname, and not ban any other nickname. At least, that's how it _should_ work :)

And

Code: Select all

  # change this numeric to the number for the nickname of offending user (currently set to 4 for example)
  set nicktoban [lindex [split $text] 4]
as stated, you would change the 4 to whatever numeric the nickname is.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
Post Reply