<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/20095" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2016-02-13T22:28:51-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/20095</id>

		<entry>
		<author><name><![CDATA[Sedition]]></name></author>
		<updated>2016-02-13T22:28:51-04:00</updated>

		<published>2016-02-13T22:28:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104687#p104687</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104687#p104687"/>
		<title type="html"><![CDATA[help please anti caps for arfer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104687#p104687"><![CDATA[
# web <a href="http://forum.egghelp.org/viewtopic.php?t=17178" class="postlink">http://forum.egghelp.org/viewtopic.php?t=17178</a><br>## updates anti caps for arfer my bros <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> ##<br>   ## random phrases was added to the kick method.<br>   ## It was added that recognize nicknames and channels random phrases (%chan %nick)<br>   ## my email <a href="mailto:urquizoandrade@hotmail.com">urquizoandrade@hotmail.com</a> /server irc.dal.net #tcls and #lapaz<br><br>set nocapsauth "arfer"<br>set nocapsversion "v1.0.5"<br><br># set bot user flags to ignore text<br>set vCapsFlagsAllow fo <br><br># set text length (excluding spaces) to allow without checking<br>set vCapsLengthAllow 3<br><br># set maximum percentage caps allowed (calculation excludes spaces in text)<br># greater than 0, less than or equal to 100<br>set vCapsPercentAllow 90<br><br># set number of warnings before punishing<br># integer value equal to or greater than 1<br>set vCapsWarnings 2<br><br># set here the mode of punishment - metodo de kick<br># 1 == kick only (after warnings)<br># 2 == kickban (after warnings)<br>set vCapsPunishMode 1<br><br># time in minutes within which a warning remains valid<br># even after the user is punished, passed offences remain valid for this time period<br># hence a user could be punished twice for two consecutive offences<br>set vCapsSinTime 4<br><br># if punishment mode 2, set here the time in minutes the ban lasts<br>set vCapsBanTime 10<br><br>### random phrases ##<br> <br>set nocapspb {<br>"%nick  Please lower your capital letters, uppercase means shouting in %c."<br>"Please Disables capitalization Thanks, %nick it's like you scream in %c."<br>"Do not use capitalization, %nick it's like you shout in %c, Please avoid using them."<br>}<br><br>proc ctcp_capslock {nick uhost hand chan keyword arg} {<br> pCapsDetect $nick $uhost $hand $chan $arg<br>}<br><br>bind PUBM - * pCapsDetect<br>bind ctcp - ACTION ctcp_capslock<br><br>proc pCapsDetect {nick uhost hand chan text} {<br>    global vCapsBanTime vCapsFlagsAllow vCapsLengthAllow vCapsPercentAllow nocapspb<br>    global vCapsPunishMode vCapsSinBin vCapsSinTime vCapsWarnings<br>    if {[botisop $chan]} {<br>        if {![matchattr [nick2hand $nick] $vCapsFlagsAllow $chan]} {<br>            set caps [regexp -all -- {[A-Z]} $text]<br>            set total [string length [regsub -all -- {[\s]} $text {}]]<br>            if {$total &gt; $vCapsLengthAllow} {<br>                set percent [expr {$caps * 100.0 / $total}]<br>                if {$percent &gt; $vCapsPercentAllow} {<br>                    set now [unixtime]<br>                    set max [expr {$now - ($vCapsSinTime * 60)}]<br>                    lappend vCapsSinBin(${nick},$chan) $now<br>                    foreach sin $vCapsSinBin(${nick},$chan) {<br>                        if {$sin &gt;= $max} {lappend newlist $sin}<br>                    }<br>                    set vCapsSinBin(${nick},$chan) $newlist<br>                    if {[llength $vCapsSinBin(${nick},$chan)]&gt; $vCapsWarnings} {<br>                        switch -- $vCapsPunishMode {<br>                            1 {}<br>                            2 {<br>                         pushmode $chan +b $uhost<br>                         timer $vCapsBanTime [list pushmode $chan -b $uhost]<br>                            }<br>                            default {return 0}<br>                        }<br>                        putkick $chan $nick "no caps please autoban for $vCapsBanTime min. excess caps, in ($vCapsPercentAllow%)"<br>                       putserv "MODE $chan +b $uhost" -next<br>                        timer $vCapsBanTime [list pushmode $chan -b $uhost]<br>                  } else {<br>                  set drem [lindex $nocapspb [rand [llength $nocapspb]]]<br>                        set output "*** 12[llength $vCapsSinBin(${nick},$chan)] 4Notice *** 14ò.Ó 14$drem"<br>                  regsub -all -- {%c} $output $chan output<br>  putserv "PRIVMSG $chan :[regsub -all -- {%nick} $output $nick]"<br>                    }<br>                }<br>            }<br>        }<br>    }<br>    return 0<br>} <br><br>putlog "anticaps $nocapsversion by $nocapsauth has been loaded successfully"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11854">Sedition</a> — Sat Feb 13, 2016 10:28 pm</p><hr />
]]></content>
	</entry>
	</feed>
