egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ban kick for Realname

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Sun Aug 23, 2015 5:56 am    Post subject: Ban kick for Realname Reply with quote

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 Smile
Back to top
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Sun Aug 23, 2015 7:08 am    Post subject: Reply with quote

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

Code:

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."
}

_________________
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.


Last edited by Get_A_Fix on Fri Jan 27, 2017 9:29 am; edited 1 time in total
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Sun Aug 23, 2015 7:22 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Mon Aug 24, 2015 3:05 am    Post subject: Reply with quote

[quote="juanamores"]
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:

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 Very Happy
_________________
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 Smile
Back to top
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Tue Aug 25, 2015 10:34 am    Post subject: Reply with quote

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:

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 Smile

And
Code:

  # 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.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber