Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bind pubm - "*" check_caps
- set chanpro(caps_percent) 70
- set chanpro(caps_minimum) 10
- set chanpro(caps) 1
- proc check_caps {nick host hand chan text} {
- set caps 0
- set total_string [expr [string length $text] - [regsub -all -- " " $text * *]]
- global chanpro
- #check if CAPS-check is disabled, if so - return
- if {!$chanpro(caps)} {return 0}
- #Prüfen wie viele Buchstaben Groß sind
- foreach char [split $text ""] {
- if {[string match *$char* "ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ"]} {incr caps}
- }
- #Prüfen wie viel % Gro geschrieben sind
- if {$caps == 0 || $total_string == 0} {return 0}
- set percent [expr $caps.0 / $total_string * 100]
- #Prüfen ob die %-Großgeschriebener Buchstaben größer ist als die Max-%-Zahl für Caps.
- if {$percent < $chanpro(caps_percent) || $total_string < $chanpro(caps_minimum)} {return 0}
- set percent [expr $caps.0 / $total_string * 100]
- #Prüfen ob die %-Großgeschriebener Buchstaben größer ist als die Max-%-Zahl für Caps.
- if {$percent < $chanpro(caps_percent) || $total_string < $chanpro(caps_minimum)} {return 0}
- #Prüft ob der User ein Op ist.
- # if {[isop $nick $chan]} {
- # return 0
- # }
- #Sendet das Ergebnis zum Kick-proc weiter...
- actions $nick $host $chan "caps"
- }
- #Kick/timeout
- proc actions {nick host chan what} {
- if {[info exists user($nick)]} { incr user($nick)
- } else {
- set user($nick) 0
- }
- set kick 1
- set caps(1) 2*60
- set caps(2) 4*60
- set caps(3) 6*60
- puthelp "privmsg $chan : $user($nick)"
- if {$user($nick) == 1} {
- puthelp "privmsg $chan :.timeout $nick $kick"
- }
- if {$user($nick) == 2} {
- puthelp "privmsg $chan :.timeout $caps(1)"
- }
- if {$user($nick) == 3} {
- puthelp "privmsg $chan :.timeout $caps(2)"
- }
- if {$user($nick) >= 4} {
- puthelp "privmsg $chan :.timeout $caps(3)"
- }
- }
Add Comment
Please, Sign In to add comment