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

	<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>2003-02-19T15:48:31-04:00</updated>

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

		<entry>
		<author><name><![CDATA[simonbell]]></name></author>
		<updated>2003-02-19T15:48:31-04:00</updated>

		<published>2003-02-19T15:48:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16786#p16786</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16786#p16786"/>
		<title type="html"><![CDATA[adding \]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16786#p16786"><![CDATA[
Sorry, ive removed the script above as the person i was writing it for changed his mind about what he wanted. I would just like to know for knowledges sake how i would actually add a \ infront of a character in a string which is }<br><br>Would it be via the string map command? or would i use something else?<br><br>thanks<br>Simon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1696">simonbell</a> — Wed Feb 19, 2003 3:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-02-19T14:12:18-04:00</updated>

		<published>2003-02-19T14:12:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16783#p16783</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16783#p16783"/>
		<title type="html"><![CDATA[adding \]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16783#p16783"><![CDATA[
<blockquote class="uncited"><div>to narrow this down slightly ive been looking at the string map command.<br>[snip]<br>Simon</div></blockquote>This is not needed. ppslim already pointed at a weakness in your script.<br><br>Let me review it step by step.<br><br>Step 1. You save the $nick and $host to file. By the way you save it, each line is now a string in the datafile.<br><br>Step 2.  "set show [read $showopen]". This will read the whole file, as is, into the variable "show".<br><br>Step 3. "close $showopen".<br>                                 <br>Step 4. "foreach listnick [split $show \n] {" The variable $show is splitted around the newline character into a list. Note that each list element of $show is a string by itself i.e. the variable $listnick contains a string (a single line from the file) and not a list.<br><br>Step 5. "if { [lindex $listnick 1] == $whoishost } {" And this is where things go wrong. The variable $listnick contains a string and not a list. You are performing the listcommand [lindex] on the string $listnick.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Wed Feb 19, 2003 2:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simonbell]]></name></author>
		<updated>2003-02-19T13:59:02-04:00</updated>

		<published>2003-02-19T13:59:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16782#p16782</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16782#p16782"/>
		<title type="html"><![CDATA[adding \]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16782#p16782"><![CDATA[
to narrow this down slightly ive been looking at the string map command.<br><br>Im not exactly how i would get this to work, but using<br><blockquote class="uncited"><div>putlog "[string map "\{" "\\{"]"</div></blockquote>creates 'unmatched open brace in list ' errors...<br><br>Simon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1696">simonbell</a> — Wed Feb 19, 2003 1:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-02-16T11:35:19-04:00</updated>

		<published>2003-02-16T11:35:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16658#p16658</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16658#p16658"/>
		<title type="html"><![CDATA[adding \]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16658#p16658"><![CDATA[
Change this line<div class="codebox"><p>Code: </p><pre><code>foreach listnick [split $show \n] {</code></pre></div>To<div class="codebox"><p>Code: </p><pre><code>foreach listnick [split [split $show \n]] {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sun Feb 16, 2003 11:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simonbell]]></name></author>
		<updated>2003-02-16T11:30:43-04:00</updated>

		<published>2003-02-16T11:30:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16657#p16657</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16657#p16657"/>
		<title type="html"><![CDATA[adding \]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16657#p16657"><![CDATA[
The script which adds information to the database is this:<br><blockquote class="uncited"><div> putlog "NickHost: Join check on $nick: Adding new host $host"<br> set filewrite [open $nickdb a]<br> puts $filewrite "$nick $host"<br> close $filewrite</div></blockquote>$nick being the nick of the person who just joined the channel, etc<br><br>Then, a user submits a request to view certain information, and this part of the script is used:<br><blockquote class="uncited"><div> putnotc $nick "Nicks in the database matching the host: \002$whoishost\002"<br> set showopen [open $nickdb r]<br> set show [read $showopen]<br> close $showopen<br> foreach listnick [split $show \n] {<br>  if { [lindex $listnick 1] == $whoishost } {<br>   putnotc $nick "\002ø\002 [lindex $listnick 0]"<br>   }<br>  }</div></blockquote>This just lists the nicks matching a certain host which are in the file.<br><br>It was working fine. Now, when a user with { in there nick joined and was registered by the bot, whenever anyone requests information, the script *can* still work, although sometimes it does, but the error message<br><blockquote class="uncited"><div>&lt;InfinitY&gt; [15:30] Tcl error [savehost-whois]: unmatched open brace in list</div></blockquote>Simon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1696">simonbell</a> — Sun Feb 16, 2003 11:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-02-16T11:03:40-04:00</updated>

		<published>2003-02-16T11:03:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16655#p16655</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16655#p16655"/>
		<title type="html"><![CDATA[adding \]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16655#p16655"><![CDATA[
The trick is to handle them correctly in the first place.<br><br>The simplest way to extract information, is using list commands, however, most users pass stings too them.<br><br>This causes incorrectly escaped charcters within variables or return values.<br><br>It would be wise to post the code that is causing trouble, and we should be able to help more.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sun Feb 16, 2003 11:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simonbell]]></name></author>
		<updated>2003-02-16T10:30:09-04:00</updated>

		<published>2003-02-16T10:30:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16653#p16653</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16653#p16653"/>
		<title type="html"><![CDATA[adding \]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16653#p16653"><![CDATA[
Ive written a script which effecitvely safes user nicks and some information about them to a file. Ive encountered a problem that when nicks contain { and [ the script gets confused. How would i go about checking each time a nick is to be added to the database and adding a \ infront of each character such as { and [ so that the script takes them as normal characters.<br><br>thanks<br>Simon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1696">simonbell</a> — Sun Feb 16, 2003 10:30 am</p><hr />
]]></content>
	</entry>
	</feed>
