| View previous topic :: View next topic |
| Author |
Message |
drfox Voice
Joined: 09 Oct 2005 Posts: 26
|
Posted: Tue Nov 08, 2005 8:46 pm Post subject: help please |
|
|
hi is there a way of adapting this so i can add a list of host addresses to the script so it ignores then if they do a nick change.
thanx
| Code: | ### Introduction
# Anti Bad-Nick Script
# SadSalman <-> salman.mehmood@gmail.com
# Version No: 0.2
### Features:
# * Sets a 2 Minute Channel ban on user who writes any of the
# defined bad words
# * Doesn't ban users with +o OR +f flags
# * Logs ALL user/op messages containing the defined words
# * Strips Character Codes from Messages
### Set Bad Words that you want the Bot to Kick on
set badnicks {
"Fox"
"fox"
}
### Set Your Ban Reason
set badnickreason "Bad Nick, Please change it and rejoin"
### Set Ban Time
set bnduration 24h
### Begin Script:
## (Don't change anything below here... Unless you know tcl)
## Binding all joins to our Process
bind join - * filter_bad_nicks
bind nick - * filter_bad_nicks_change
## Starting Process
proc filter_bad_nicks {nick uhost hand channel} {
global badnicks badnickreason banmask botnick bnduration
set handle [nick2hand $nick]
set banmask "*$nick*!*@*"
foreach badnick [string tolower $badnicks] {
if {[string match *$badnick* [string tolower $nick]]} {
if {[matchattr $handle +f]} {
putlog "-Anti Bad Nick Script- $nick ($handle) with +f joined $channel"
} elseif {[matchattr $handle +o]} {
putlog "-Anti Bad Nick Script- $nick ($handle) with +o flags joined $channel"
} else {
putlog "-Anti Bad Nick Script- KICKED $nick on $channel"
putquick "KICK $channel $nick :$badnickreason"
newchanban $channel $banmask $botnick $badnickreason $bnduration
}
}
}
}
## Starting Process
proc filter_bad_nicks_change {nick uhost hand channel newnick} {
global badnicks badnickreason banmask botnick
set handle [nick2hand $newnick]
set banmask "*$newnick*!*@*"
set duration 10m
foreach badnick [string tolower $badnicks] {
if {[string match *$badnick* [string tolower $newnick]]} {
if {[matchattr $handle +f]} {
putlog "-Anti Bad Nick Script- $nick ($handle) with +f changed nickname to $newnick on $channel"
} elseif {[matchattr $handle +o]} {
putlog "-Anti Bad Nick Script- $nick ($handle) with +o flags changed nickname to $newnick on $channel"
} else {
putlog "-Anti Bad Nick Script- KICKED $newnick on $channel"
putquick "KICK $channel $newnick :$badnickreason"
newchanban $channel $banmask $botnick $badnickreason 2m
}
}
}
}
bind join - * filter_bad_nicks
bind nick - * filter_bad_nicks_change
putlog "SadSalman's Anti Bad Nick Script Loaded" |
|
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Tue Nov 08, 2005 10:41 pm Post subject: |
|
|
the following should exempt bot users marked as operators, voice, or friends from the check:
| Code: |
proc filter_bad_nicks {nick uhost hand channel} {
global badnicks badnickreason banmask botnick bnduration
set handle [nick2hand $nick]
if [matchattr $hand ovf|ovf $chan] return
set banmask "*$nick*!*@*"
|
| Code: |
proc filter_bad_nicks_change {nick uhost hand channel newnick} {
global badnicks badnickreason banmask botnick
set handle [nick2hand $newnick]
if [matchattr $hand ovf|ovf $chan] return
set banmask "*$newnick*!*@*"
|
|
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Wed Nov 09, 2005 2:08 am Post subject: |
|
|
I wonder when will people get to the inevitable conclusion that universal xchannel.tcl is much better than zillions of naive scripts like this, does all the stuff they do, and more
I've said it in the past, I'll repeat it again: The Tcl Archive needs some sort of fair rating system, so people won't waste their time with lame scripts and go directly for the best _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Wed Nov 09, 2005 10:41 am Post subject: |
|
|
Blowing our own trumpet demond? _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
drfox Voice
Joined: 09 Oct 2005 Posts: 26
|
Posted: Wed Nov 09, 2005 7:30 pm Post subject: |
|
|
yeah thanx guys but the reason i need to add a list of host for it to ignore
is because if i add a nick to the bot as a user it wont allow nicks over 9 letters
example silver-man becomes silver-ma when added
so if the script could be altered so allow me to add hosts for it to ignore
that would be great
thanx |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Wed Nov 09, 2005 8:43 pm Post subject: adding exempted hosts |
|
|
using the code I gave you will exempt any person in the bot's userlist that is set as a global op, voice, friend, or as a channel op, voice, friend
easy enough to add hostmasks to bot users
edit the script's code and insert:
| Code: | | if [matchattr $hand ovf|ovf $chan] return |
where shown in my prior post |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Nov 10, 2005 5:24 am Post subject: |
|
|
The script already exempts +f and +o users, so what you need to do drfox is to add a handle such as friends and give it the +f flag then simply add all hosts to this handle instead of adding a handle for each nick. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
drfox Voice
Joined: 09 Oct 2005 Posts: 26
|
Posted: Thu Nov 10, 2005 2:31 pm Post subject: |
|
|
ok i did that and rehashed it but it still banns that nick and i carnt add it to the bots user list because it wont let me add the full nick every time i try it leves off any letters above 9
example doom-master
if i add that it only comes up as below
[6:48pm] <04Dr-Fox> .+user doom-master *!@*FC4F3BA9.5F70542C.B5943CF.IP
[6:48pm] <Fox-Help> [03:55] #Dr-Fox# +user doom-mast *!@*FC4F3BA9.5F70542C.B5943CF.IP
[6:48pm] <Fox-Help> Added doom-mast (*!@*FC4F3BA9.5F70542C.B5943CF.IP)
only the nick doom-mast is added so it still bans doom-master
Last edited by drfox on Thu Nov 10, 2005 2:49 pm; edited 1 time in total |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Nov 10, 2005 2:37 pm Post subject: |
|
|
You don't need to add anything into it, +o and +f are already exempted. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
drfox Voice
Joined: 09 Oct 2005 Posts: 26
|
Posted: Thu Nov 10, 2005 2:53 pm Post subject: |
|
|
but the prob is i carnt add the full nick to the bots user list and when i give the nick a +o flag because the full nick is not added it dont work
[6:48pm] <04Dr-Fox> .+user doom-master *!@*FC4F3BA9.5F70542C.B5943CF.IP
[6:48pm] <Fox-Help> [03:55] #Dr-Fox# +user doom-mast *!@*FC4F3BA9.5F70542C.B5943CF.IP
[6:48pm] <Fox-Help> Added doom-mast (*!@*FC4F3BA9.5F70542C.B5943CF.IP) |
|
| Back to top |
|
 |
]Kami[ Owner

Joined: 24 Jul 2003 Posts: 590 Location: Slovenia
|
Posted: Thu Nov 10, 2005 3:31 pm Post subject: |
|
|
They because handle lenght limit in eggdrop.h
Search this forum for "handle lenght" _________________ Slovene Eggdrop Page |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Nov 10, 2005 7:32 pm Post subject: |
|
|
| Sir_Fz wrote: | | The script already exempts +f and +o users, so what you need to do drfox is to add a handle such as friends and give it the +f flag then simply add all hosts to this handle instead of adding a handle for each nick. |
That means:
| Quote: | .+user friends
.chattr friends +f
.chpass friends sdkfjsdfksjfsj |
and then simply to exempt someone use:
| Quote: | | .+host friends *!*@*FC4F3BA9.5F70542C.B5943CF.IP |
Handle character limit will not be a problem in this case. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Thu Nov 10, 2005 11:31 pm Post subject: |
|
|
| Alchera wrote: | | Blowing our own trumpet demond? |
apparently yes; that being said, I would't hesitate to recommend any other script or module, mine or not, which is among the best (or IS the best) in its category: netbots, sentinel, botnetop, gseen, stats.mod, megahal, the most popular web scripts for google, tv, weather, etc.
so, what seems to you as vanity is actually simply an opinion that people should use and learn from the best, instead of wasting their time with fixing inherently inferior scripts (and you can't possibly argue that xchannel doesn't deserve its place among the best) _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Nov 11, 2005 12:25 am Post subject: |
|
|
An old but very true saying:
"Self praise is no praise at all." _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
drfox Voice
Joined: 09 Oct 2005 Posts: 26
|
Posted: Fri Nov 11, 2005 8:42 pm Post subject: |
|
|
| thanx Sir_Fz thats a great help |
|
| Back to top |
|
 |
|