| View previous topic :: View next topic |
| Author |
Message |
Passionate Voice
Joined: 25 Oct 2005 Posts: 15
|
Posted: Sun Nov 26, 2006 10:26 am Post subject: Bad Channel |
|
|
| Code: |
bind join - * bad:whois
bind raw - 319 bad:chan:chk
# Set your Bad channel kicker's CHANNELS here (Type in lower case)
set bchan_chans "#Kickerchan"
# Set your Bad channel kicker's KICK MSG here
set bchan_kmsg "You are on a bad channel"
######### Stop editing here, unless u know how to #####
set badchanwrds "#badchannel1 badchannel2 badchannel3"
proc bad:whois {n h c a} {
global join_ctr
if {[isbotnick $n]} {return 0}
set c [string tolower $c]
if {[matchattr $h f]} {return 0}
putserv "WHOIS $n"
if {![info exists join_ctr($c)]} {set join_ctr($c) 0}
incr join_ctr($c) 1
if {$join_ctr($c) >= "5"} {
set join_ctr($c) 1
if {[catch {unbind join - * bad:whois}]} {}
utimer 2 whois:reset
}
}
proc whois:reset {} {
bind join - * bad:whois
}
set colore {([\002\017\026\037]|[\003]{1}[0-9]{0,2}[\,]{0,1}[0-9]{0,2})}
proc bad:chan:chk {from mask args} {
global badchanwrds colore
set args [split $args]
set nick [lindex $args 1]
set listchans [lrange $args 2 end]
regexp -- {^:?(.*)$} [join $listchans] -> text
set text [split $text]
regsub -all $colore $text {} text
foreach txt $text {
foreach bw $badchanwrds {
if {[string match -nocase "$bw" "$txt"]} {
badchan:kick $nick
break
}
}
}
}
proc badchan:kick {nick} {
global bchan_chans bchan_bantime bchan_kmsg
foreach chan $bchan_chans {
if {[onchan $nick $chan]} {
if {([isop $nick $chan]) || (![botisop $chan])} {return 0}
set bmask [getchanhost $nick $chan] ; set bmask [lindex [split $bmask @] 1]
putquick "MODE $chan +b *!*@$bmask" -next
putquick "KICK $chan $nick : $bchan_kmsg" -next
return 0
}
return 0
}
}
foreach c $bchan_chans {
set join_ctr($c) 0
}
array set join_ctr {}
|
Just a small change i need here, In the kick msg i want the bad channel to
be listed.
I mean the user should know for which bad channel he got kicked. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Nov 26, 2006 10:39 am Post subject: |
|
|
Replace
with
| Code: | | badchan:kick $nick $bw |
and
| Code: | | proc badchan:kick {nick} { |
with
| Code: | | proc badchan:kick {nick bchan} { |
then replace
| Code: | | putquick "KICK $chan $nick : $bchan_kmsg" -next |
with
| Code: | | putquick "KICK $chan $nick : $bchan_kmsg ($bchan)" -next |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Passionate Voice
Joined: 25 Oct 2005 Posts: 15
|
Posted: Mon Nov 27, 2006 1:11 am Post subject: |
|
|
Thank You Sir_Fz
Rgds |
|
| Back to top |
|
 |
|