Top

Swear Check


TCL Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Feb 13, 2009
Last Updated  Mar 19, 2009
Tags  badword  protection  swear 

Introduction

I checked the snippets and only found mIRC platform swear kickers.

This is a simple swear checker that can be adjusted to each channel via dcc (partyline) or a public/msg command.

Protects all users added to bot userfile, all channel @/Ops and +/Voices.

PUBLIC TRIGGER: '.'

SYNTAX:
-------

PUBLIC: .swearcheck on
PUBLIC: .swearcheck off

MSG: /msg yourbot swearcheck #channelname on
MSG: /msg yourbot swearcheck #channelname off

NOTE: Available to Global OP (o) and above.

Grab the Code

set pubtrig .
 
setudef flag swearcheck
 
set swearwords {
  "*fuck*"
  "*cunt*"
  "*shit*"
}
 
bind pub - ${pubtrig}swearcheck chanset:swearcheck
proc chanset:swearcheck {nick uhost hand chan text} {
  global botnick
  if {[matchattr $hand o]} {
 
    if {[lindex $text 0] == "on"} {
      channel set $chan +swearcheck
      puthelp "PRIVMSG $chan :Enabled Swear Protection for $chan"
    }
 
    if {[lindex $text 0] == "off"} {
      channel set $chan -swearcheck
      puthelp "PRIVMSG $chan :Disabled Swear Protection for $chan"
    }
  }
}
 
bind msg - swearcheck swear:msg
proc swear:msg {nick uhost hand arg} {
  set chan [strlwr [lindex $arg 0]]
  if {[matchattr $hand o]} {
 
      if {[lindex $arg 1] == "on"} {
      channel set $chan +swearcheck
      putquick "NOTICE $nick :Enabled Swear Protection for $chan"
    }
 
    if {[lindex $arg 1] == "off"} {
      channel set $chan -swearcheck
      putquick "NOTICE $nick :Disabled Swear Protection for $chan"
    }
  }
}
 
bind pubm - * swear:check
proc swear:check {nick uhost hand chan text} {
  global botnick swearwords
  if {[lsearch -exact [channel info $chan] +swearcheck] != -1} {
    foreach pattern $swearwords {
      if {[string match -nocase $pattern $text]} {
        if {(![validuser $hand]) && (![isop $nick $chan]) && (![isvoice $nick $chan])} {
          putquick "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
          putquick "KICK $chan $nick :\002\037S\037\002wear-\002\037W\037\002ord \002\037D\037\002etected. - Matching: $pattern"
        }
      }
    }
  }
}
 
putlog "Swear:Check - Loaded!"

Comments

  (0)  RSS

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom