| View previous topic :: View next topic |
| Author |
Message |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sun Aug 23, 2015 5:56 am Post subject: Ban kick for Realname |
|
|
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  |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Sun Aug 23, 2015 7:08 am Post subject: |
|
|
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 |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sun Aug 23, 2015 7:22 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Mon Aug 24, 2015 3:05 am Post subject: |
|
|
[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  _________________ 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  |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Tue Aug 25, 2015 10:34 am Post subject: |
|
|
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
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 |
|
 |
|