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

	<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>2007-10-24T15:31:54-04:00</updated>

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

		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2007-10-24T15:31:54-04:00</updated>

		<published>2007-10-24T15:31:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77080#p77080</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77080#p77080"/>
		<title type="html"><![CDATA[trouble with a nick containing [ ]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77080#p77080"><![CDATA[
I'll try this tomorrow and give a report here, it might be an add to the FAQ about strings.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Oct 24, 2007 3:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-10-24T12:09:07-04:00</updated>

		<published>2007-10-24T12:09:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77076#p77076</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77076#p77076"/>
		<title type="html"><![CDATA[trouble with a nick containing [ ]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77076#p77076"><![CDATA[
The glob-style patternmatching is the cause of your issues, so adding -exact will solve that issue.<br><br>Yet, you should'nt use split over and over again...<br><br>Something like this then, perhaps?<div class="codebox"><p>Code: </p><pre><code>... set exclude $::excludednicks lappend exclude $::botnick...</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Oct 24, 2007 12:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2007-10-24T12:02:31-04:00</updated>

		<published>2007-10-24T12:02:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77074#p77074</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77074#p77074"/>
		<title type="html"><![CDATA[trouble with a nick containing [ ]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77074#p77074"><![CDATA[
The trouble I've is that the list of excluded nicks is a configuration setting of the tcl, I can't ask users to use something different than the name the see on IRC.<br><br>Bu I'll try the lsearch with options like -exact and -ascii, peharps this is the solution <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Oct 24, 2007 12:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-10-24T11:56:36-04:00</updated>

		<published>2007-10-24T11:56:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77073#p77073</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77073#p77073"/>
		<title type="html"><![CDATA[trouble with a nick containing [ ]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77073#p77073"><![CDATA[
Keep in mind that lsearch uses glob-style patterns unless you specify otherwize.<br><br>Have you considdered using proper lists? Right now, you're splitting lists, which can damage contents.<br><br>Also, you really should check for the condition where the excluded nick was not found (-1 returned)...<br><br> <div class="codebox"><p>Code: </p><pre><code>proc test {nick uhost handle chan arg} { set exclude [list $::botnick {[nick1]} {[nick2]}] set users [chanlist $chan] foreach excl $exclude {  if {[set ind [lsearch -exact $users $excl]] &gt;= 0} {   putlog "$excl - $users =&gt; $ind"   set users [lreplace $users $ind $ind]  } }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Oct 24, 2007 11:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2007-10-24T10:44:06-04:00</updated>

		<published>2007-10-24T10:44:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77066#p77066</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77066#p77066"/>
		<title type="html"><![CDATA[trouble with a nick containing [ ]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77066#p77066"><![CDATA[
I've found a method I used previously: a filtering procedure:<div class="codebox"><p>Code: </p><pre><code>proc filt {data} {    regsub -all -- \\\\ $data \\\\\\\\ data    regsub -all -- \\\[ $data \\\\\[ data    regsub -all -- \\\] $data \\\\\] data    regsub -all -- \\\} $data \\\\\} data    regsub -all -- \\\{ $data \\\\\{ data    regsub -all -- \\\" $data \\\\\" data    return $data}</code></pre></div>I don't really like it, I'm sure a real solution exists...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Oct 24, 2007 10:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2007-10-24T08:03:55-04:00</updated>

		<published>2007-10-24T08:03:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77059#p77059</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77059#p77059"/>
		<title type="html"><![CDATA[trouble with a nick containing [ ]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77059#p77059"><![CDATA[
I know this is a recurent trouble but I can't find the solution, I've tried all my ideas.<br><br>I'm trying to exlude some users in a procedure (some bots) and their nick is <strong class="text-strong">[nick]</strong><br>So, I do:<div class="codebox"><p>Code: </p><pre><code>proc test {nick uhost handle chan args} {   set exclbot "\[nick1\] \[nick2\]"   set exclude [split "$::botnick $exclbot"]   set users [chanlist $chan]   foreach excl [split $exclude] {      set ind [lsearch $users $excl]      putlog "$excl - $users =&gt; $ind"      set users [lreplace $users $ind $ind]   }}</code></pre></div>When the tcl found [nick1] or [nick2], the lsearch returns -1 and I've in the log:<div class="codebox"><p>Code: </p><pre><code>{[nick1]} - {[nick1]} {[nick2]} =&gt; -1</code></pre></div>I can't understand why the result is not 0... it works well with others users...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Oct 24, 2007 8:03 am</p><hr />
]]></content>
	</entry>
	</feed>
