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

	<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-10-30T18:25:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[BiLL]]></name></author>
		<updated>2003-10-30T18:25:25-04:00</updated>

		<published>2003-10-30T18:25:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29215#p29215</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29215#p29215"/>
		<title type="html"><![CDATA[lreplace and lsearch combination]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29215#p29215"><![CDATA[
great that works perfect thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=50">BiLL</a> — Thu Oct 30, 2003 6:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-10-30T17:23:02-04:00</updated>

		<published>2003-10-30T17:23:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29213#p29213</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29213#p29213"/>
		<title type="html"><![CDATA[lreplace and lsearch combination]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29213#p29213"><![CDATA[
<blockquote class="uncited"><div>Its because I am using NICK, &lt;- if i leave the , it works. With , it doenst work. You maybe can help me with that also? </div></blockquote>NICK is not NICK, in a list<br><br>here's a better proc (and no, it's not by me <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">)<div class="codebox"><p>Code: </p><pre><code>proc varrep {string what with} {if {![string match "*$what*" $string]} {return $string}set cutstart [expr [string first $what $string] - 1]set cutstop  [expr $cutstart + [string length $what] + 1]set string [string range $string 0 $cutstart]$with[string range $string $cutstop end]return $string}</code></pre></div>set msg [varrep $msg "nick" $::botnick]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Thu Oct 30, 2003 5:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BiLL]]></name></author>
		<updated>2003-10-30T16:53:27-04:00</updated>

		<published>2003-10-30T16:53:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29210#p29210</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29210#p29210"/>
		<title type="html"><![CDATA[lreplace and lsearch combination]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29210#p29210"><![CDATA[
please someone help me i don't know how to fix that <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":-(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=50">BiLL</a> — Thu Oct 30, 2003 4:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BiLL]]></name></author>
		<updated>2003-10-30T12:13:01-04:00</updated>

		<published>2003-10-30T12:13:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29196#p29196</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29196#p29196"/>
		<title type="html"><![CDATA[lreplace and lsearch combination]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29196#p29196"><![CDATA[
Ah, I found the bug <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>Hehe.<br><br><br>Its because I am using that msg:<br><br>greetings, please query NICK, this is my msg.<br><br>Its because I am using NICK, &lt;- if i leave the , it works. With , it doenst work. You maybe can help me with that also? So I can replace NICK, with my IRCNICK, ? There should be a way!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=50">BiLL</a> — Thu Oct 30, 2003 12:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-10-30T11:45:47-04:00</updated>

		<published>2003-10-30T11:45:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29195#p29195</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29195#p29195"/>
		<title type="html"><![CDATA[lreplace and lsearch combination]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29195#p29195"><![CDATA[
<blockquote class="uncited"><div>IRC is still not beeing replaced and my irc-nick lands in front of $msg <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad">.</div></blockquote>Check if the element is found before you do the replacement (like my lsearch of [channels] in our <a href="http://forum.egghelp.org/viewtopic.php?t=5963" class="postlink">previous thread</a>)<br>'lsearch' returns -1 when what you search for is not found in the list and that's the only thing that could cause this behaviour. Again: check the case of that word in your list.. are you sure it's in all uppercase like the element you search for?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Oct 30, 2003 11:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BiLL]]></name></author>
		<updated>2003-10-30T11:37:56-04:00</updated>

		<published>2003-10-30T11:37:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29194#p29194</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29194#p29194"/>
		<title type="html"><![CDATA[lreplace and lsearch combination]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29194#p29194"><![CDATA[
Hi,<br><br>thanks for your answer.<br><br>set msg [split $msg]<br>set msg [lreplace $msg [lsearch $msg "IRC"] [lsearch $msg "IRC"] $nick] <br>set msg [join $msg]<br><br>I tried this code now but it's still the same. IRC is still not beeing replaced and my irc-nick lands in front of $msg <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad">.<br><br>Any other idea??<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=50">BiLL</a> — Thu Oct 30, 2003 11:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-10-30T11:29:35-04:00</updated>

		<published>2003-10-30T11:29:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29193#p29193</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29193#p29193"/>
		<title type="html"><![CDATA[lreplace and lsearch combination]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29193#p29193"><![CDATA[
My guess is that the element "IRC" is not found, so 'lsearch' returns "-1" and that's where your nick ends up <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> (remember: it's case sensitive)<br>Also make sure your $msg is a list before using list commands on it<div class="codebox"><p>Code: </p><pre><code>set msg [split $msg]</code></pre></div> and then <div class="codebox"><p>Code: </p><pre><code>set msg [join $msg]</code></pre></div> if you want it output as a string later on.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Oct 30, 2003 11:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BiLL]]></name></author>
		<updated>2003-10-30T11:10:20-04:00</updated>

		<published>2003-10-30T11:10:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29192#p29192</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29192#p29192"/>
		<title type="html"><![CDATA[lreplace and lsearch combination]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29192#p29192"><![CDATA[
Hi,<br><br>I got a problem with lreplace and lsearch <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad">. I tried a few ways but I don't get it working correctly!<br><br><br>I got his:<br><br>msg = Hello Guys. Blablabla bla bla IRC bla bla bla bla.<br><br>I want to replace in $msg that IRC with $nick (current nick of the triggerer).<br><br>So I tried this one:<br><br>set msg [lreplace $msg [lsearch $msg "IRC"] [lsearch $msg "IRC"] $nick]<br><br>But then he put's $nick in FRONT of the line instead of replacing IRC with $nick <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad">.<br><br>Can someone help me please?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=50">BiLL</a> — Thu Oct 30, 2003 11:10 am</p><hr />
]]></content>
	</entry>
	</feed>
