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

	<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>2005-01-12T09:34:14-04:00</updated>

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

		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-12T09:34:14-04:00</updated>

		<published>2005-01-12T09:34:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45314#p45314</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45314#p45314"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45314#p45314"><![CDATA[
Ofcourse I do. I am steewpid, but surely not that much too. My definition of a list would be "A combination of one or more elements placed together to from bunch of elements; list". Like for example I make a list of my groceries, weekly which are finished and need to be bought from the supermarket. And each grocery item from that list would represent a seperate element in the list.<br><br>A list would have seperate elements, like for examples of lists:<br>set names { {name1} {name2} {name3} }<br>set names { "name1" "name2" "name3" }<br><br>My knowledge of a string would be basically a string more than one character, if I am correct, which has nothing todo with elements seperately.<br><br>set name "my name is bla bla...."<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Jan 12, 2005 9:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-01-12T09:16:35-04:00</updated>

		<published>2005-01-12T09:16:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45312#p45312</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45312#p45312"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45312#p45312"><![CDATA[
<blockquote class="uncited"><div>Yes, I did read your post. Or instead we can use string range, instead of lrange, then splitting and then joining back.</div></blockquote>They have nothing in common except for the fact that they extract ranges. What is your point? Do you understand what a list is?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Jan 12, 2005 9:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-12T08:42:22-04:00</updated>

		<published>2005-01-12T08:42:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45311#p45311</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45311#p45311"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45311#p45311"><![CDATA[
Yes, I did read your post. Or instead we can use string range, instead of lrange, then splitting and then joining back.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Jan 12, 2005 8:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-01-12T08:15:11-04:00</updated>

		<published>2005-01-12T08:15:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45308#p45308</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45308#p45308"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45308#p45308"><![CDATA[
Did you read my post?<br>Strings and lists are not the same but you can convert string to lists using 'split' and lists to strings using 'join'.<br>You should have 'split' the string before using 'lrange' on it and 'join'ed the result to get a string to output.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Jan 12, 2005 8:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-12T07:55:31-04:00</updated>

		<published>2005-01-12T07:55:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45307#p45307</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45307#p45307"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45307#p45307"><![CDATA[
One of the clear facts here being that user, I used the same simple topic script and after the trigger I had some text, which had special characters such as those square brackets. When I said the bot to trigger it, it set the topic with {, }'s in return while I had supplied a set of [, ]'s to be set.<br><br>So, if I would have used string range, then all would have been well, ain't it?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Jan 12, 2005 7:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-01-12T07:28:25-04:00</updated>

		<published>2005-01-12T07:28:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45305#p45305</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45305#p45305"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45305#p45305"><![CDATA[
<blockquote class="uncited"><div>As for why you get the, extra parasynthesis { and } when you have special tcl characters in your output, new versions of eggdrop and tcl interpreter tries to escape those characters. For example in this script:<br><div class="codebox"><p>Code: </p><pre><code>bind pub m !topic topicproc topic {nick host hand chan text} { putquick "TOPIC $chan :[lrange $text 0 end]"}</code></pre></div>If you use [ or ] in the topic, when the bot places the topic the [ and ] characters will be replaced by the same curly bracket parasynthesis so the script doesn't choke.<br><br>Also if a variable is a list then all the elements in the list are displayed within the curly brackets, especially when you use .tcl in partyline.</div></blockquote>Wrong.<br>Tcl/eggdrop does no such thing. lrange extracts a range of elements from a LIST and returns a new LIST (You used it on a string in your example, which is not a good idea. (try your example with a "{" in the string))<br>Tcl escapes the content of list elements (when needed) to be able to tell where each element ends.<br><br>I suggest you read and understand the page you posted a link to yourself before giving any more advice on this subject. (or making any more scripts for that matter)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Jan 12, 2005 7:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-11T21:22:16-04:00</updated>

		<published>2005-01-11T21:22:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45298#p45298</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45298#p45298"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45298#p45298"><![CDATA[
This might be because lappend would be using it in a list form (seperate elements) so hence you got the {, }'s. However append will use it in a normal string format so you shouldn't get the parasynthesis.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Tue Jan 11, 2005 9:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iguana]]></name></author>
		<updated>2005-01-11T21:16:38-04:00</updated>

		<published>2005-01-11T21:16:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45296#p45296</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45296#p45296"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45296#p45296"><![CDATA[
I managed to drop the { }'s by using <strong class="text-strong">append </strong>as opposed to <strong class="text-strong">lappend</strong>, I presume that append has been reworked in a new version of eggdrop/interpreter to discard the curly brackets.<br><br>I now understand the \'s as well now, they are escape so it means "treat the next character as a <strong class="text-strong">charater </strong>and <strong class="text-strong">not </strong>a TCL command/code string (if I understand you correctly! <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=5844">iguana</a> — Tue Jan 11, 2005 9:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-11T20:54:12-04:00</updated>

		<published>2005-01-11T20:54:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45294#p45294</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45294#p45294"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45294#p45294"><![CDATA[
[, ], {, }, ", ?, \, are all special tcl characters used for coding purposes. So you have to escape them using an "\" infront of them for it to work.<br><div class="codebox"><p>Code: </p><pre><code>#Will not work: putserv "PRIVMSG $chan :[Stats] for $chan is:"#Will work: putserv "PRIVMSG $chan :\[Stats\] for $chan is:"</code></pre></div>Take a look at:<br><a href="http://www.peterre.com/characters.html" class="postlink">http://www.peterre.com/characters.html</a><br><br>As for why you get the, extra parasynthesis { and } when you have special tcl characters in your output, new versions of eggdrop and tcl interpreter tries to escape those characters. For example in this script:<br><div class="codebox"><p>Code: </p><pre><code>bind pub m !topic topicproc topic {nick host hand chan text} { putquick "TOPIC $chan :[lrange $text 0 end]"}</code></pre></div>If you use [ or ] in the topic, when the bot places the topic the [ and ] characters will be replaced by the same curly bracket parasynthesis so the script doesn't choke.<br><br>Also if a variable is a list then all the elements in the list are displayed within the curly brackets, especially when you use .tcl in partyline.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Tue Jan 11, 2005 8:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iguana]]></name></author>
		<updated>2005-01-11T20:20:13-04:00</updated>

		<published>2005-01-11T20:20:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45292#p45292</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45292#p45292"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45292#p45292"><![CDATA[
Ah no, it's ok, sorted it, removed<div class="codebox"><p>Code: </p><pre><code>lappend result [string trim $nick],</code></pre></div>and replaced with <div class="codebox"><p>Code: </p><pre><code>append result $nick ", "</code></pre></div>Seemed to sort it. <br><br>If you wonder why I posted back here I hate it when people say they fixed it and never told you how so you are always wondering how when you get the same problems! <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=5844">iguana</a> — Tue Jan 11, 2005 8:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iguana]]></name></author>
		<updated>2005-01-11T19:53:14-04:00</updated>

		<published>2005-01-11T19:53:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45291#p45291</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45291#p45291"/>
		<title type="html"><![CDATA[Help with weird results]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45291#p45291"><![CDATA[
Reference a previous post I made, I got my script I wanted working fine (or as well as I could do). Remembering this is only my second bit of coding in TCL, anyone give me any pointers on the following code to reduce it in size or is it pretty my all that is required?<br><br>The other thing, it has some weird postings on IRC, for example, if the result has a "[" or and "]" in it, it prints a { } around the result. Any idea of how to get rid of that? It only does it when I use the <div class="codebox"><p>Code: </p><pre><code>lappend result [string trim $nick], </code></pre></div>line and doesnt do it if its put direct to the IRC channel with the <div class="codebox"><p>Code: </p><pre><code>puthelp "privmsg $channel :$nick ($times )"</code></pre></div> command.<br><br>Here's the full code.<div class="codebox"><p>Code: </p><pre><code>package require httpbind pub - !guid guidproc guid {n u h channel t} {set length [string length $t]if {$length == 0|| $t == "help"} {puthelp "notice $n :Enter a GUID of 8 characters or more to return a list of all aliases associated with it.. GUID Checker Beta 0.5" ; return 0 }if {$length &lt; 8} {puthelp "privmsg $channel :GUID's must be 8 characters or more." ; return 0 }set page [::http::geturl *site here*=$t]set content [split [::http::data $page] \n]regsub -all -nocase { } $content " " tosaveregsub -all -nocase {&lt;[^&gt;*&gt;]} $tosave {} tosaveregsub -all -nocase {&lt;td&gt;|&lt;/td&gt;|d&gt;|td&gt;} $tosave {} tosaveregsub -all -nocase {&gt;} $tosave "&gt;" tosaveregsub -all -nocase {&lt;} $tosave "&lt;" tosave::http::cleanup $contentset result ""for {set x 127} {$x&lt;500} {incr x 6} {set nick [lindex $tosave $x]    set times [lindex $tosave [expr {$x +1}]]if {$nick == ""} {break}#puthelp "privmsg $channel :$nick ($times )"lappend result [string trim $nick], }if {$result == "html&gt;,"} {puthelp "privmsg $channel :Nothing found, please check GUID and try again!"} else {puthelp "privmsg $channel :Aliases used by GUID $t"puthelp "privmsg $channel :$result"}}</code></pre></div>This is still in beta and needs more error checking putting in I know (hence some commented lines that were/are used for debugging).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5844">iguana</a> — Tue Jan 11, 2005 7:53 pm</p><hr />
]]></content>
	</entry>
	</feed>
