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.

Whois ban

Old posts that have not been replied to for several years.
R
Rob
Voice
Posts: 25
Joined: Thu Aug 01, 2002 1:21 pm

Post by Rob »

Excellent stuff. Will try this later on.
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

caesar could u make this script be like this:
when I do .clean it will WHOIS all users in the channel and if a user has the same nick and full name would be banned.
I tried to do it alone but I couldn't :(
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Yes I can it but will lag it when will do this *proces*.. if the channel is small then won't be a problem but if it's big it will be. Actualy instead of an whois on each user it can simply do an who #channel and collect the users from there or something like this anyway.
Once the game is over, the king and the pawn go back in the same box.
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

it's a big channel and you're right it's better to do /who can you do it with the who command pls?
«A fantastic spaghetti is a spaghetti that does not exist»
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You will benefit a lot from the use of the WHO command.

Eggdrop does a WHO on join, so this can be captured (IE, no extra bandwidth).

During this, you should store the who information for each user in memory. Delete it on part and exit (I would on netsplit as well). Who people that join (and store).

Seeing as you can't change the details mid-connection, a .clean command can do it all from memory.

This will mean the only extra bandwidth needed, is when a person joins.
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

I made that script :) but.. I wanna protect some addresses from being banned if they have the same nickname and fullname
this one doesn't work:

Code: Select all

if {$address == "*.users.undernet.org"} {
.....
}
coz it checks for the address *.users.undernet.org and not any address which ends with .users.undernet.org
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

# What reason whould you like to be used as reason for ban?
set bad(reason) "Bad boy!" 

# How many minutes whould you like the ban to be?
set bad(time) 60

### Done with configurations, do not edit past here unless you know TCL. ###

# binds #
bind dcc n clean dcc:clean
bind raw - 352 who:check

# clean #
proc dcc:clean {hand idx text} {
  set chan [lindex $text 0]
  set bidx "$idx"
  if {[lindex $text 0] == ""} {
    putdcc $idx "Usage: clean <channel>"
    return
  }
  if {[validchan $chan] && [botisop $chan]} {
    putdcc $idx "Cleaning $chan.."
    putserv "WHO $chan"
    return
  }
  putdcc $idx "$chan is not an valid channel, I'm not on it (+inactive) or I'm not oped there."
}

# who check #
proc who:check {from key arg} { 
  set chan [lindex $arg 1]
  set nick [lindex $arg 5]
  set realname [lrange [lindex [split $arg ":"] 1] 1 end]
  if {$nick == $::botnick || [matchattr [nick2hand $nick] of|fo $chan]} {
    return
  }
  if {$nick == $realname} {
    newchanban $chan [maskhost [lindex [split $arg] 3]] $::botnick $::bad(reason) $::bad(time)
  }
}

putlog "clean.tcl.. loaded"
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Also, for your *protection* thing you may use something like:

Code: Select all

if {[string match *@*.users.undernet.org [string tolower [maskhost [lindex [split $arg] 3]]]} {
Once the game is over, the king and the pawn go back in the same box.
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

thanx, the script works fine
I also noticed that this:

Code: Select all

if {[string match *@*.users.undernet.org [string tolower [maskhost [lindex [split $arg] 3]]]} { ...... }
didn't work and I replaced *@*.users.undernet.org with *users.undernet.org and I added || so I protected 3-4 other domains that I wanted.
Also, could u tell me how could I make it protect the users that have at least one CAPITAL letter in their ident?
«A fantastic spaghetti is a spaghetti that does not exist»
n
nut

Post by nut »

hi!
i think this script is a very good idea! but i still have 2 questions: why does is it not work with bold or something like that in the realnames? i want to add the realnames of some takescripts like mirkforce. with this realnames it doesn't work. the second: is it possible to add wildcards to the addet realname? at my test, it doesn't work. i hope, you can help me :-)
greetz nut
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

Code: Select all

# badrealname.tcl 
# original code by Papillon 
# modified by caesar 

# What bad realnames should be banned? 
set badr(list) { 
"foo bar" 
"bla bla" 
"moo" 
} 

# The realname check should be done only in what channel? 
set badr(chan) "#channel" 

# For how many minutes whould you like the ban? 
set badr(time) 60 

# What reason will be used when an person is found using an bad realname? 
set badr(reason) "You norteh norteh boy!" 

# binds # 
bind join - "$badr(chan) *" badrealname:join 
bind raw - 311 badrealname:check 

# join # 
proc badrealname:join {nick host hand chan} { 
  if {![validuser $hand] || [strlwr $nick] != [strlwr $::botnick]} { 
    putserv "WHOIS $nick" 
  } 
} 

# check # 
proc badrealname:check {from key arg} { 
  set realname [lindex [lrange [split $arg ":"] 1 end] 0] 
  foreach bah $::badr(list) { 
    if {$realname != $bah} { 
      continue 
    } 
    newchanban $::badr(chan) [maskhost [lindex [split $arg] 3]] $::botnick $::badr(reason) $::badr(time) 
    break 
  } 
} 

putlog "badrealname.tcl.. loaded." 
Replace this

Code: Select all

  foreach bah $::badr(list) { 
    if {$realname != $bah} { 
      continue 
    } 
with this

Code: Select all

foreach bah $::badr(list) { 
    if {![string match $bah $realname]} {
      continue 
    } 
I hope it works :)
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

1. use this to filter out the bold, underline, revese, italic and colour. Thanks to ppslim for the code.

Code: Select all

if {[ctrl:filter $text] != $text} {
return
} 

proc ctrl:filter {str} {regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str ; return $str} 
2. yes, eg:

Code: Select all

set badr(list) { 
"*moo*" 
} 
Also, you may do an string tolower (strlwr) to the realname and to the bad realnames from the list in order to match them better.
Once the game is over, the king and the pawn go back in the same box.
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

could you also answer to me please?
thanx, the script works fine
I also noticed that this:
Code:
if {[string match *@*.users.undernet.org [string tolower [maskhost [lindex [split $arg] 3]]]} { ...... }

didn't work and I replaced *@*.users.undernet.org with *users.undernet.org and I added || so I protected 3-4 other domains that I wanted.
Also, could u tell me how could I make it protect the users that have at least one CAPITAL letter in their ident?
«A fantastic spaghetti is a spaghetti that does not exist»
n
nut

Post by nut »

hi!
thank you very much for your help. my third problem is: i'm not able to complete the script. my knowledges about tcl are very, very small.
my last request in this topic: could you paste the complete working script with support for bold, underline ... i tried, but my bot crashed all time.
i hope you help me. :oops:
nut
d
dax47988

something similar

Post by dax47988 »

i been looking for something similar to this an idiot keeps messing around evading bans then coming in and being generally offensive

however he always joins irc with the same nick then changes it

is there a way for a bot to see his nick on the network then make a banmask !*!@*.host using that BEFORE he coimes into the channel?
Locked