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.
Locked
R
Rob
Voice
Posts: 25
Joined: Thu Aug 01, 2002 1:21 pm

Whois ban

Post by Rob »

Can anyone help with a script that will whois users who join a channel and if they have a realname which matched against a banned realname they will be kick, banned. This is mainly because we are getting problems on our channels with floods but they all seem to use the same realname but on different hosts.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

just do /mode #channel +b *!realname@*
no need to script it
Elen sila lúmenn' omentielvo
R
Rob
Voice
Posts: 25
Joined: Thu Aug 01, 2002 1:21 pm

Post by Rob »

That would be the username/ident you would be reffering too, but they use random usernames/idents but the same Realname

This is what I am after in the whois (for example)
••• ibuki is Zer0@ACBDC895.ipt.aol.com
••• ibuki is «Evil Capcom»

... so if I was to set Evil Capcom as a realname to be banned, the bot would whois them when they join then kick ban them out.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

ah... my mistake.. I'm out of coofee :roll:
Elen sila lúmenn' omentielvo
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

#set this to the "bad" realanme
set badrealname "somerealname"
#set this to the length in mins of the ban
set bantime 60 
#set this to the reason for the ban
set banreason "You norteh norteh boy!"
#set this to the channel where it should take effect
set banchan "#channel"

bind join - "$banchan *" ban:on:realname
proc ban:on:realname {nick host hand chan} {
	if {![validuser $hand]} {
		putserv "WHOIS $nick"
	}
}

bind raw - 311 check:realname
proc check:realname {from key arg} {
	global badrealname banreason bantime botnick
	set realname [lindex [split $arg] end]
	if {$realname == $badrealname} {
		newchanban $banchan [maskhost [lindex [split $arg] 3]] $botnick $banreason $bantime -sticky
	}
}
this is made without me having coofee and it is untested... try it at your own risk ;)
Elen sila lúmenn' omentielvo
R
Rob
Voice
Posts: 25
Joined: Thu Aug 01, 2002 1:21 pm

Post by Rob »

/me Makes Papillon a strong mug of coffee

Sorry to be a pain but the script loaded ok, but isnt picking up on banned realnames :(
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

ahhh thx :) helps alot
now:

Code: Select all

set realname [lindex [split $arg] end]
should be

Code: Select all

set realname [string range [lindex [split $arg] end] 1 end]
also I forgot to add the banchan to the global line

^^ do this and try again, should work now.... coofee really does wonders
Elen sila lúmenn' omentielvo
R
Rob
Voice
Posts: 25
Joined: Thu Aug 01, 2002 1:21 pm

Post by Rob »

nice one works a treat, thnx for the help.
R
Rob
Voice
Posts: 25
Joined: Thu Aug 01, 2002 1:21 pm

Post by Rob »

Just picked up on this, it bans the test user on the realname set to Evil but not when its set to Evil Capcom in both the client and tcl.

Ive tried the following which seems to work for evil again but still refuses to work with anything with a space.

Code: Select all

set badrealname {
  Evil Capcom
  Evil
}
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

this script is very basic and only matches if the badrealname is exactly like the users realname... I'll leave it to you to figure out how to fix this..
after all, we are not here to make scripts for you, we're here to help you make your own ;)
Elen sila lúmenn' omentielvo
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

is it possible to check the realname and the nickname too and if realname is the same with the nick it perm ban the user?
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

yes.
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

how? :P
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Start by understanding every part of the code Papillon gave you.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I've took the liberty to mess around a bit with the code and noticed some stuff that I would like to share. I've looked on the result of the realname result and the realname starts with : so it's better to use something like:

Code: Select all

set realname [lindex [lrange [split $arg ":"] 1 end] 0]
instead of

Code: Select all

set realname [string range [lindex [split $arg] end] 1 end]
Also I've played around with the code and made this one:

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."
Once the game is over, the king and the pawn go back in the same box.
Locked