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.

Bad Channel

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
P
Passionate
Voice
Posts: 15
Joined: Tue Oct 25, 2005 9:38 am

Bad Channel

Post by Passionate »

Code: Select all

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Replace

Code: Select all

badchan:kick $nick
with

Code: Select all

badchan:kick $nick $bw
and

Code: Select all

proc badchan:kick {nick} {
with

Code: Select all

proc badchan:kick {nick bchan} {
then replace

Code: Select all

putquick "KICK $chan $nick : $bchan_kmsg" -next
with

Code: Select all

putquick "KICK $chan $nick : $bchan_kmsg ($bchan)" -next
P
Passionate
Voice
Posts: 15
Joined: Tue Oct 25, 2005 9:38 am

Post by Passionate »

Thank You Sir_Fz

Rgds
Post Reply