egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bad Channel

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Passionate
Voice


Joined: 25 Oct 2005
Posts: 15

PostPosted: Sun Nov 26, 2006 10:26 am    Post subject: Bad Channel Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Nov 26, 2006 10:39 am    Post subject: Reply with quote

Replace
Code:
badchan:kick $nick

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
View user's profile Send private message Visit poster's website
Passionate
Voice


Joined: 25 Oct 2005
Posts: 15

PostPosted: Mon Nov 27, 2006 1:11 am    Post subject: Reply with quote

Thank You Sir_Fz

Rgds
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber