<?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/2575" />

	<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>2002-09-12T12:04:59-04:00</updated>

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

		<entry>
		<author><name><![CDATA[darko``]]></name></author>
		<updated>2002-09-12T12:04:59-04:00</updated>

		<published>2002-09-12T12:04:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10810#p10810</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10810#p10810"/>
		<title type="html"><![CDATA[caps help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10810#p10810"><![CDATA[
Yeah, rewrite the code, it looks awfull :/<br>Regular expressions are a perfect thing to use in such cases:<br><br>regexp -all \[A-Z\] $text<br><br>will return the number of uppercase letters in variable $text.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1881">darko``</a> — Thu Sep 12, 2002 12:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-09-12T01:09:31-04:00</updated>

		<published>2002-09-12T01:09:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10793#p10793</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10793#p10793"/>
		<title type="html"><![CDATA[caps help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10793#p10793"><![CDATA[
The reason "hmmmm HELLOOOOO HOW ARE YOU" isn't working is that it's reading it as 65% caps and the script's caps threshold is 65%. It has nothing to do with having caps in the middle of the text.<br><br>If you want it to be stricter, reduce the 65 to something like 30.<br><br>I don't understand what you wanted to do about spaces.<br><br>The only real programming error is the "incr i -1". It should use a different variable, because that is making it not read in the last few chars of the string, and the caps percent gets messed up (too low).<br><br>Just a note, even though it pretty much works, that's some really ugly code heh. I'd rewrite it if I were you.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Thu Sep 12, 2002 1:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-09-11T21:25:55-04:00</updated>

		<published>2002-09-11T21:25:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10791#p10791</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10791#p10791"/>
		<title type="html"><![CDATA[caps help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10791#p10791"><![CDATA[
Hi, this script is working fine but when caps are in the middle of the text, then it doesn't work, but if text starts with caps its works fine<br><br>like<br>hmmmm  HELLOOOOO HOW ARE YOU (doesn't work)<br>but<br>HELLOOOOO HOW ARE YOU (worked)<br>i think it counts spaces too, i will appreciate if someone can help me to fix this<br><br>proc check_caps {text} {<br>set i [string length $text]<br>set caps 0.0<br>for {set x 0} {$x&lt;$i} {incr x} {<br>set cc [string index $text $x]<br>if {[string match {[A-Z]} $cc]} {set caps [expr $caps+1]}<br>if {[string match " " $cc]} {incr i -1}<br>}<br>return [list [expr int($caps/$i*100)]]<br>}<br><br>proc caps_test {nick user hand chan text} {<br>global channel bantime botnick  <br>set stati [chattr $hand]<br>set pperc [check_caps $text]<br>set perc [lindex $pperc 0]<br>if {$perc&gt;65 &amp;&amp; [string length $text]&gt;15} {<br><br>                 .....kick stuff...<br><br>thanks<br>regards<br>Aw<p>Statistics: Posted by Guest — Wed Sep 11, 2002 9:25 pm</p><hr />
]]></content>
	</entry>
	</feed>
