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

	<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>2004-05-02T05:49:34-04:00</updated>

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

		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-05-02T05:49:34-04:00</updated>

		<published>2004-05-02T05:49:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36029#p36029</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36029#p36029"/>
		<title type="html"><![CDATA[replacing line problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36029#p36029"><![CDATA[
As I told you on irc, no, you don't NEED it to be "text", because in Tcl,<br><strong class="text-strong">set var word</strong> , is the same as <strong class="text-strong">set var "word"</strong> ...<br>If it is a multi-word, the list command will make it <strong class="text-strong">set var {word1 word2}</strong>, which is essentially the same as <strong class="text-strong">set var "word1 word2"</strong>, less variable substitution, which your original line will take care of anyway...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sun May 02, 2004 5:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[collett9]]></name></author>
		<updated>2004-05-02T02:25:34-04:00</updated>

		<published>2004-05-02T02:25:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36025#p36025</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36025#p36025"/>
		<title type="html"><![CDATA[replacing line problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36025#p36025"><![CDATA[
yea, that's what I needed, however it poses yet another problem<br><br>in the file it actually sets it as:<div class="codebox"><p>Code: </p><pre><code>set variwannaset text</code></pre></div><br><br>instead of what I NEED it to be<div class="codebox"><p>Code: </p><pre><code>set variwannaset "text"</code></pre></div><br>I've also tried the<div class="codebox"><p>Code: </p><pre><code>[list set variwannaset "\"$text\""]</code></pre></div>and every combination I possibly know...<br><br><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=4267">collett9</a> — Sun May 02, 2004 2:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-05-01T19:03:26-04:00</updated>

		<published>2004-05-01T19:03:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36022#p36022</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36022#p36022"/>
		<title type="html"><![CDATA[replacing line problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36022#p36022"><![CDATA[
I think this is what you want... <div class="codebox"><p>Code: </p><pre><code>replaceLines vars.tcl 76 76 [list set variwannaset "$text"]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Sat May 01, 2004 7:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-04-30T00:53:25-04:00</updated>

		<published>2004-04-30T00:53:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35982#p35982</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35982#p35982"/>
		<title type="html"><![CDATA[replacing line problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35982#p35982"><![CDATA[
The script you found seems to remove line 76 and add another one onto the very end. You want to replace 76? Change the lreplace command to add the new line in place of the one you remove. See the tcl manual <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/contents.htm" class="postlink">http://www.tcl.tk/man/tcl8.4/TclCmd/contents.htm</a> for the lreplace command for details.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Fri Apr 30, 2004 12:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[collett9]]></name></author>
		<updated>2004-04-30T00:24:02-04:00</updated>

		<published>2004-04-30T00:24:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35981#p35981</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35981#p35981"/>
		<title type="html"><![CDATA[replacing line problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35981#p35981"><![CDATA[
Well after my last post and getting that to work, it turned out not to be what I needed exactly.<br><br><br>I need to REPLACE the line, so I did a bit of searching and found:<br><br><a href="http://forum.egghelp.org/viewtopic.php?p=27613#27613" class="postlink">http://forum.egghelp.org/viewtopic.php?p=27613#27613</a><br><br>Here is what I have, and it's not working:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !setvar replaceLinesbind pub - !setvar cmd:setvarproc replaceLines {args} {    if {[llength $args]&gt;=3} {       foreach {file start end} $args break       set cmd [list lreplace [split [read [set f [open $file r]]] \n] $start $end]       close $f       if {[llength $args]&gt;3} {lappend cmd [lindex $args 3]}       puts -nonewline [set f [open $file w]] [join [eval $cmd] \n]       close $f    } {       error "wrong # args: should be \"[lindex [info level 0] 0] file start end ?replacement?\""    } } proc cmd:setvar {nick host handle chan text} { global privchan variwannaset foreach channel $privchan {   if {$chan == "$privchan"} {   set variwannaset "$text"   replaceLines vars.tcl 76 76 [set variwannaset "$text"]   putquick "NOTICE $nick :Variable has been set to: \002$variwannaset\002"   } }}</code></pre></div>(As you can tell, the line I want to edit is 76)<br><br>Help?  <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=4267">collett9</a> — Fri Apr 30, 2004 12:24 am</p><hr />
]]></content>
	</entry>
	</feed>
