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 

help please

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
drfox
Voice


Joined: 09 Oct 2005
Posts: 26

PostPosted: Tue Nov 08, 2005 8:46 pm    Post subject: help please Reply with quote

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
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Tue Nov 08, 2005 10:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Wed Nov 09, 2005 2:08 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Nov 09, 2005 10:41 am    Post subject: Reply with quote

Blowing our own trumpet demond?
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
drfox
Voice


Joined: 09 Oct 2005
Posts: 26

PostPosted: Wed Nov 09, 2005 7:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Wed Nov 09, 2005 8:43 pm    Post subject: adding exempted hosts Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Nov 10, 2005 5:24 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
drfox
Voice


Joined: 09 Oct 2005
Posts: 26

PostPosted: Thu Nov 10, 2005 2:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Nov 10, 2005 2:37 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
drfox
Voice


Joined: 09 Oct 2005
Posts: 26

PostPosted: Thu Nov 10, 2005 2:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
]Kami[
Owner


Joined: 24 Jul 2003
Posts: 590
Location: Slovenia

PostPosted: Thu Nov 10, 2005 3:31 pm    Post subject: Reply with quote

They because handle lenght limit in eggdrop.h

Search this forum for "handle lenght"
_________________
Slovene Eggdrop Page
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Nov 10, 2005 7:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Thu Nov 10, 2005 11:31 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Nov 11, 2005 12:25 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
drfox
Voice


Joined: 09 Oct 2005
Posts: 26

PostPosted: Fri Nov 11, 2005 8:42 pm    Post subject: Reply with quote

thanx Sir_Fz thats a great help
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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