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

	<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>2008-01-09T23:41:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2008-01-09T23:41:53-04:00</updated>

		<published>2008-01-09T23:41:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79925#p79925</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79925#p79925"/>
		<title type="html"><![CDATA[A big problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79925#p79925"><![CDATA[
First off all, thanks for your replys<br>Second,<br><blockquote class="uncited"><div>You expect the first character to be a #, not the \003 color control-code.</div></blockquote>nml375, I`m not expecting for every user who wants to make a advertise with colors, bolds or underlines to start there advertise with # and then the \003 | \037 | \002 .... I tryin to make a if statement so that this script will ban *ONLY* simple text that contain \003 , \037 or \002.<br><blockquote class="uncited"><div>Keep in mind that ^ means start of word, so the expression "^#\w" will only match when # is the very first character in the word, not when the first character is a \003 (which is what you used for testing). </div></blockquote>I`ve tryed to remove the "^#\w" and leave only this part:<div class="codebox"><p>Code: </p><pre><code>if {[regexp {(?i)(http://|www\.|\s#\w)} $text]}</code></pre></div>This si the result (including TCL_no_TK's suggestion):<br><blockquote class="uncited"><div>&lt;teste22&gt; <span style="color:blue">mmmm test</span><br>* |EGG sets mode: +b *!*@127.0.0.1 <br>* teste22 was kicked by |EGG (NO colors allowed here!)<br>&lt;@me&gt; .tcl killchanban #channels *!*@127.0.0.1<br>&lt;@|EGG&gt; OK: 1 - 0.029 ms<br>* |tester sets mode: -b *!*@X101.DSL02.lipetsk.ru<br>* Joins: teste22 (~test@127.0.0.1) <br>&lt;teste22&gt; <span style="color:blue">mmmm #test</span><br>* |EGG sets mode: +b *!*@127.0.0.1 <br>* teste22 was kicked by |EGG (NO colors allowed here!)<br>&lt;@me&gt; .tcl killchanban #channels *!*@127.0.0.1<br>&lt;@|EGG&gt; OK: 1 - 0.031 ms<br>&lt;teste22&gt; <span style="color:blue">mmmm <a href="http://test.ro" class="postlink">http://test.ro</a></span><br>* |EGG sets mode: +b *!*@127.0.0.1 <br>* teste22 was kicked by |EGG (NO colors allowed here!)</div></blockquote>.... now the user gets ban if he types #|http:// or any type of channel/web advertise <br><br>I`ll try to fing other ways in the code for the bot NOT to ban ( with this script ) users who use in there messages #* | http://* | ftp://* | <a href="www" class="postlink">www</a>.*<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Wed Jan 09, 2008 11:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-01-09T10:46:18-04:00</updated>

		<published>2008-01-09T10:46:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79897#p79897</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79897#p79897"/>
		<title type="html"><![CDATA[A big problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79897#p79897"><![CDATA[
The code is pretty much fine, the regular expression however is flawed.<br>You expect the first character to be a #, not the \003 color control-code. Also, I fail to see the purpose of the (?i) entity in your expression.<br><br>Keep in mind that ^ means start of word, so the expression "^#\w" will only match when # is the very first character in the word, not when the first character is a \003 (which is what you used for testing). One easy workaround might be to use the stripcodes command to remove any and all control-codes before running the regular expression.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jan 09, 2008 10:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TCL_no_TK]]></name></author>
		<updated>2008-01-09T01:13:51-04:00</updated>

		<published>2008-01-09T01:13:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79886#p79886</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79886#p79886"/>
		<title type="html"><![CDATA[A big problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79886#p79886"><![CDATA[
Try changing <div class="codebox"><p>Code: </p><pre><code> if {[regexp {(?i)(http://|www\.|\s#\w|^#\w)} $text]} {  return 1 } else {  ban $nick $uhost $hand $chan $text }   return 0}</code></pre></div> to <div class="codebox"><p>Code: </p><pre><code> if {[regexp {(?i)(http://|www\.|\s#\w|^#\w)} $text]} {return 0} else {ban "$nick $uhost $hand $chan $text"; return 1}; return}</code></pre></div> Am not good with regexp but i think thats the reutrn's sorted out.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8130">TCL_no_TK</a> — Wed Jan 09, 2008 1:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2008-01-09T00:20:03-04:00</updated>

		<published>2008-01-09T00:20:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79885#p79885</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79885#p79885"/>
		<title type="html"><![CDATA[A big problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79885#p79885"><![CDATA[
Heya guys, I have a issue with a tcl I`m trying to upgrade...<br><br>Here is the code<br><div class="codebox"><p>Code: </p><pre><code># color.tclset color(chan) "#chan"set color(kickmsg) "NO colors allowed here!"set color(bantime) "60"### END CFG ###bind pubm - * s:colorproc s:color {nick uhost hand chan text} { global botnick color  if {[matchattr $hand of|of $chan] || [isop $nick $chan] || [isvoice $nick $chan]}  { return 0 }  if {(([lsearch -exact [string tolower $color(chan)] [string tolower $chan]] != -1) || ($color(chan) == "*")) &amp;&amp; (![matchattr $hand b]) &amp;&amp; ($nick != $botnick)} {    if {[string match *\003* $text]} {      if {[regexp {(?i)(http://|www\.|\s#\w|^#\w)} $text]} {        return 1      } else {        ban $nick $uhost $hand $chan $text      }      return 0     }  }}proc ban {nick uhost hand chan text} { global botnick color   set ban "*!*@[lindex [split $uhost @] 1]"   newchanban $chan $ban color $color(kickmsg) $color(bantime)   putquick "KICK $chan $nick :$color(kickmsg)"   return 1}putlog "color.tcl loaded!"</code></pre></div>So here is the main idea ... as the code show's I`m trying to make this tcl ban only users who use <strong class="text-strong">color text</strong> only, and will NOT ban those type of text that contain channel/web advertise. ( because that job is done by another code...)<br><br>Now the problem:<br><blockquote class="uncited"><div>(05:19:29) * Joins: teste1 (~test@127.0.0.1)<br><em class="text-italics">(05:19:35) &lt;teste1&gt; <span style="color:red">#test</span><br>(05:19:35) * |EGG sets mode: +b *!*@127.0.0.1<br>(05:19:35) * teste1 was kicked by |EGG (NO colors allowed here!)</em></div></blockquote>This is not the way I want the code to work!! When the user typed "<span style="color:red">#test</span>" (with the red color) the reaction should be null ( return 1 )<br><br>This is the wright way for this code to work<br><blockquote class="uncited"><div>(05:29:29) * Joins: teste1 (~test@127.0.0.1)<br><em class="text-italics"><strong class="text-strong">(05:29:35) &lt;teste1&gt; <span style="color:red">#test</span></strong></em><br>..... no banning ( the above text normaly will activate the chan/web advertise script )<br>(05:29:46) &lt;teste1&gt; <span style="color:red">color test</span><br>(05:29:46) * |EGG sets mode: +b *!*@127.0.0.1<br>(05:29:46) * teste1 was kicked by |EGG (NO colors allowed here!)<br>..... do the ban ( corect order )</div></blockquote>What's the bug ?!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_question.gif" width="15" height="15" alt=":?:" title="Question">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_exclaim.gif" width="15" height="15" alt=":!:" title="Exclamation">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_arrow.gif" width="15" height="15" alt=":arrow:" title="Arrow"> <br><br>Any ideas how to fix it ? .... ( hope so  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> )<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Wed Jan 09, 2008 12:20 am</p><hr />
]]></content>
	</entry>
	</feed>
