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.

help please

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
d
drfox
Voice
Posts: 26
Joined: Sun Oct 09, 2005 1:51 am

help please

Post by drfox »

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: Select all

### 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"
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

the following should exempt bot users marked as operators, voice, or friends from the check:

Code: Select all

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: Select all

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*!*@*" 
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Blowing our own trumpet demond?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
d
drfox
Voice
Posts: 26
Joined: Sun Oct 09, 2005 1:51 am

Post by drfox »

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
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

adding exempted hosts

Post by DragnLord »

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: Select all

if [matchattr $hand ovf|ovf $chan] return
where shown in my prior post
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
d
drfox
Voice
Posts: 26
Joined: Sun Oct 09, 2005 1:51 am

Post by drfox »

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.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You don't need to add anything into it, +o and +f are already exempted.
d
drfox
Voice
Posts: 26
Joined: Sun Oct 09, 2005 1:51 am

Post by drfox »

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)
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

They because handle lenght limit in eggdrop.h

Search this forum for "handle lenght"
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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:
.+user friends
.chattr friends +f
.chpass friends sdkfjsdfksjfsj
and then simply to exempt someone use:
.+host friends *!*@*FC4F3BA9.5F70542C.B5943CF.IP
Handle character limit will not be a problem in this case.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
d
drfox
Voice
Posts: 26
Joined: Sun Oct 09, 2005 1:51 am

Post by drfox »

thanx Sir_Fz thats a great help
Post Reply