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

	<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>2006-10-03T11:40:17-04:00</updated>

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

		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2006-10-03T11:40:17-04:00</updated>

		<published>2006-10-03T11:40:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66907#p66907</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66907#p66907"/>
		<title type="html"><![CDATA[Stuck with Remove Text from file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66907#p66907"><![CDATA[
what your script is meant to do and what it WOULD do are 2 very different things:<br><br><div class="codebox"><p>Code: </p><pre><code>set mrryrole "/home/kris/Love/eggdrop/marriage.role"bind msg "-|-" divorce msg_divorceproc msg_divorce { nick userhost handle text } {set file "/home/kris/Love/eggdrop/marriage.role"set delete 0set lines 0set lines [lreplace $nick end end]set fp [open $file "w"]puts $fp [join $lines "\n"]close $fpset del [lreplace $text end end]set combine [open $file "w"]puts combine [join $del "\n"]close $fileputquick "NOTICE $nick :You and $text have been divorced"putquick "PRIVMSG #PIRCS :$nick and $text have gotten a divorce"} </code></pre></div>Let's start with telling you the very wrong parts.<br><br>1: You define your file twice, you seem to have just pasted it outside the proc but you don't actually use it.<br>2: You make useless variables that you don't even use in the end.<br>3: <div class="codebox"><p>Code: </p><pre><code>set lines [lreplace $nick end end]</code></pre></div>What is this supposed to do?<br>Trust me when i say, it does not.<br><br>You use lreplace on a STRING, furthermore, what is there to replace in a 1 "word" variable, it will only contain your nick, no other words.<br><br>You open your file, and you put "$lines" in it, which probably has nothing in it. Then you make a variable called del, and you again use lreplace on a STRING, so like before, nothing exciting will happen except for the problem with special characters, then you open your file again and you again put something in it.<br><br>So like i said before, your piece of text encased in code tags makes no sense. It wouldn't do much of anything.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Tue Oct 03, 2006 11:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kris]]></name></author>
		<updated>2006-10-03T03:13:09-04:00</updated>

		<published>2006-10-03T03:13:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66902#p66902</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66902#p66902"/>
		<title type="html"><![CDATA[Stuck with Remove Text from file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66902#p66902"><![CDATA[
<blockquote class="uncited"><div>Your script makes no sense. You should at the very least know what your script is doing.</div></blockquote>i do know <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> it reads the file, and ment to delete the text and move all the other text to where it is<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8180">kris</a> — Tue Oct 03, 2006 3:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[krimson]]></name></author>
		<updated>2006-10-02T13:13:09-04:00</updated>

		<published>2006-10-02T13:13:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66879#p66879</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66879#p66879"/>
		<title type="html"><![CDATA[Stuck with Remove Text from file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66879#p66879"><![CDATA[
one thing i notice is that you're not closing 'combine' at all. <br>this: <div class="codebox"><p>Code: </p><pre><code>set combine [open $file "w"]puts combine [join $del "\n"]close $file</code></pre></div>should be this:<div class="codebox"><p>Code: </p><pre><code>set combine [open $file "w"]puts combine [join $del "\n"]close $combine</code></pre></div>a full ".tcl $errorInfo" would be of great use.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7663">krimson</a> — Mon Oct 02, 2006 1:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2006-10-02T13:11:55-04:00</updated>

		<published>2006-10-02T13:11:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66878#p66878</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66878#p66878"/>
		<title type="html"><![CDATA[Stuck with Remove Text from file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66878#p66878"><![CDATA[
Your script makes no sense. You should at the very least know what your script is doing.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Mon Oct 02, 2006 1:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kris]]></name></author>
		<updated>2006-10-02T11:47:56-04:00</updated>

		<published>2006-10-02T11:47:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66875#p66875</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66875#p66875"/>
		<title type="html"><![CDATA[Stuck with Remove Text from file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66875#p66875"><![CDATA[
ok, im reading the manual<br><br>-delenick and deletext are deleted.<br>-code brackets done.<br><br>Code:<br><div class="codebox"><p>Code: </p><pre><code>et mrryrole "/home/kris/Love/eggdrop/marriage.role"bind msg "-|-" divorce msg_divorceproc msg_divorce { nick userhost handle text } {set file "/home/kris/Love/eggdrop/marriage.role"set delete 0set lines 0set lines [lreplace $nick end end]set fp [open $file "w"]puts $fp [join $lines "\n"]close $fpset del [lreplace $text end end]set combine [open $file "w"]puts combine [join $del "\n"]close $fileputquick "NOTICE $nick :You and $text have been divorced"putquick "PRIVMSG #PIRCS :$nick and $text have gotten a divorce"}</code></pre></div>error: [02:09] Tcl error [msg_divorce]: can not find channel named "combine"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8180">kris</a> — Mon Oct 02, 2006 11:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[krimson]]></name></author>
		<updated>2006-10-02T09:28:16-04:00</updated>

		<published>2006-10-02T09:28:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66871#p66871</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66871#p66871"/>
		<title type="html"><![CDATA[Stuck with Remove Text from file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66871#p66871"><![CDATA[
- try reading the manual on <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/lreplace.htm" class="postlink">lreplace</a>. <br>- what do you use $deletenick and $deletext for?<br>- it's not such a good practice to set the file path each time you're calling the proc. this should be done somewhere outside, in a config only area<br><br>ps: please use <div class="codebox"><p>Code: </p><pre><code> tags when posting any type of code</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7663">krimson</a> — Mon Oct 02, 2006 9:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kris]]></name></author>
		<updated>2006-10-02T11:46:12-04:00</updated>

		<published>2006-10-02T08:36:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66870#p66870</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66870#p66870"/>
		<title type="html"><![CDATA[Stuck with Remove Text from file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66870#p66870"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind msg "-|-" divorce msg_divorceproc msg_divorce { nick userhost handle text } {set file "/home/kris/Love/eggdrop/marriage.role"set delete 0set lines 0set deletnick $nickset deletext $textset lines [lreplace $lines $nick $text]set fp [open $file "w"]puts $fp [join $lines "\n"]close $fpclose $fileputquick "NOTICE $nick :You and $text have been divorced"putquick "PRIVMSG #PIRCS :$nick and $text have gotten a divorce"}</code></pre></div>the error is [22:34] Tcl error [msg_divorce]: bad index "test1": must be integer or end?-integer?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8180">kris</a> — Mon Oct 02, 2006 8:36 am</p><hr />
]]></content>
	</entry>
	</feed>
