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.

script for an #idle type channel

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
swarfega
Voice
Posts: 25
Joined: Sat Oct 07, 2006 6:40 am

script for an #idle type channel

Post by swarfega »

Hi, Ive search all over for a script to do what I want without much luck.

I am trying to set up an #idle type channel and need a script (or settings) that would auto kick/ban people for 30 minutes for talking in the channel.
n
nsrafk
Halfop
Posts: 73
Joined: Fri May 11, 2007 12:25 am

Post by nsrafk »

You can just use a badword script i guess, and add wildcards.. * means anyword.. seems useless tho :p
User avatar
swarfega
Voice
Posts: 25
Joined: Sat Oct 07, 2006 6:40 am

Post by swarfega »

Thanks for the idea about using a bad words script which I am doing and works ok. What I would like to do is a ban counter. Could any one help integrate that into the code below:

Code: Select all

bind pubm -|- * blocked:words

setudef flag bwords

#Rlsdate : 28-05-2003

#? and * works as wildcards
set bwords(words) "*"
#Allow pflag to use these words ?
set bwords(p) 1
set bwords(pflag) o

#How long time to last ? must be in minutes.
set bwords(mins) 30

bind ctcp -|- * blocked:words2

proc blocked:words2 {nick uhost handle dest keyword text} {
 if {[validchan $dest]} { blocked:words $nick $uhost $handle $dest $text }
}

proc blocked:words {nick uhost handle chan text} {
global botnick bwords
 set word [join [lindex [split $text] 0]]
  if {![string match "*+bwords*" [channel info $chan]]} { return 0 }
  if {[matchattr $handle $bwords(pflag)|$bwords(pflag) $chan] && $bwords(p)==1} { return 0 }
  foreach w [split $bwords(words) " "] {
   if {[string match [join $w] [join $word]]} {
    set nck [split [getchanhost $nick] "@"]
    set b1 [split [lindex $nck 1] "\."]
    set domain [lindex $b1 [expr [llength $b1]-2]].[lindex $b1 [expr [llength $b1]-1]]
    set banmask *![lindex $nck 0]@*.$domain
    newchanban $chan $banmask $botnick "$bwords (mins) mins anti-idle ban. ([strftime %m-%d-%Y@%H:%M])" $bwords(mins)
    putlog "Banned $nick@$chan for using $word."
    return 0
   }
  }
}

putlog "Bwords loaded v2.1 : Bad words list = $bwords(words)"
Post Reply