antiswearul facut de mine:
pentru dictionar
Code:set say(lang.1.1719) "FAILED: The %r«%% bad word already exists in the channel's swear database" set say(lang.1.1720) "Added %r«%% word in the channel's swear database" set say(lang.1.1721) "USAGE: «antiswear <-add|-rem|-list> -all «" set say(lang.1.1722) "The %r«%% word doesn't exist in the channel's bad words database" set say(lang.1.1723) "Removed all words from channel's bad words database" set say(lang.1.1724) "Removed %r«%% word from channel's bad words database" set say(lang.1.1725) "Channel's bad word list (%r«%%): %b«%%" set say(lang.1.1726) "The word %r«%% %b«%% in the channel's database" set say(lang.1.1727) "FAILED: You already have 6 bad words in the channel's database" set say(lang.1.1730) "FAILED: Channel's badword database is empty"
[/code]
antiswear.tcl
pt anticore.tclCode:a:command -add antiswear pub:antiswear 1721 1721 |n proc pub:antiswear {hand chan args x mix} { global swear set opt [lindex $args 0] set words [lindex $args 1] switch -exact -- $opt { -add { if {[string equal none $words] || $words == ""} {a:usage $x antiswear ; return "Nothing"} elseif { [a:words -number swear $chan] >= 6} {a:tell $x 1727; return "FAILED: maximum reached"} elseif { [a:words -check swear $chan $words]} {a:tell $x 1719 "$words" ; return "FAILE: Word exists"} a:words -add swear $chan $words a:tell $x 1720 "$words" return "ADDED $words" } -del { if {[string equal none $words] || $words == ""} {a:usage $x antiswear ; return "Nothing"} elseif { [string equal -nocase $words -all]} {words -clean swear $chan ; a:tell $x 1723 ; return "$chan -clean"} elseif { ![a:words -check swear $chan $words]} {a:tell $x 1722 "$words"; return "NO SUCH WORD"} a:words -remove swear $chan $words a:tell $x 1724 "$words" return "REMOVED $words" } -list { if {![a:words -number swear $chan]} {a:tell $x 1730; return "NO SWEARS FOR $chan"} a:tell $x 1725 "[a:words -number swear $chan] [a:words -list swear $chan]" return "$opt" } default {a:usage $x antiswear ; return "FAILED: Not all parameters specified"} } }
iar pentru a&a_40_a_stats.tcl urmatoarele linii de codCode:proc a:anti:swear {nick uhost hand chan text args} { global swear username if {![validchan $chan] || ![botisop $chan] || [check:fo:ch $hand $chan $nick]} {return} set text [string tolower $text] set reason "" if {[channel get $chan antiswear]} { if {[string match ****** $text] || [string match ****** $text] || [string match *fuck* $text] || [string match *mata* $text] || [string match ******* $text] || [string match *dick* $text] || [string match *bitch* $text] || [string match *slut* $text] || [string match *whore* $text]} {set reason "channel antiswear protection enabled"} elseif { [a:words -number swear $chan]} { foreach s $swear($chan) {if {[string match *$s* $text]} {set reason "channel antiswear protection enabled"}} } if {$reason != ""} { newchanban $chan [a:maskhost -host $uhost] $username $reason [channel get $chan ban-time] sticky putcmdlog "<<${username}>> antiswear protection -- $chan ${nick}!${uhost}"} else {return}} } proc a:words {cmd opt {chan ""} {c ""}} { global [subst $opt] set chan [string tolower $chan] set c [string tolower $c] set wordstring [join [lrange [array get $opt $chan] 1 end]] switch -exact -- $cmd { -check { if {[string match *$c* $wordstring]} {return 1} {return 0}} -list { return $wordstring} -number { set number 0 ; foreach w $wordstring {incr number} ; return $number} -add { lappend [subst $opt]($chan) $c} -array { return [list array set $opt [array get $opt]]} -remove { regsub -all -nocase -- $c $wordstring "" [subst $opt]($chan)} -clean { catch {unset [subst $opt]($chan)}} default { return 0 } } }
dupa:Code:puts $file "\n#Swears for channels" puts $file "[a:words -array swear]"
Code:puts $file "\n#Disabled local & global commands" puts $file "[a:command -array]"


Reply With Quote

:
. DA BAN LA ORICE Cuvant scris din partea unui non @ daca este +antiswear

Bookmarks