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»
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.
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.
# 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.
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»
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
# 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."
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»
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.
nut