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

	<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-02-28T07:59:21-04:00</updated>

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

		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2005-02-28T07:59:21-04:00</updated>

		<published>2005-02-28T07:59:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47048#p47048</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47048#p47048"/>
		<title type="html"><![CDATA[write to file problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47048#p47048"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>[open $filename "w"]</code></pre></div>this will completely overwrite your file with the new information.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Mon Feb 28, 2005 7:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sparta]]></name></author>
		<updated>2005-02-28T07:55:27-04:00</updated>

		<published>2005-02-28T07:55:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47047#p47047</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47047#p47047"/>
		<title type="html"><![CDATA[write to file problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47047#p47047"><![CDATA[
if i ask like this then, how do i remove a file ? i want all old data stored in the file gone befor i add a new line to it.. the fastest way would be "rm" i guess ? but i dont know the command for that true a TCL, the comman need to be sent to the shell.. since i know the name of the file, then all i need is "command for rm" file_name .<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6022">sparta</a> — Mon Feb 28, 2005 7:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-02-28T07:43:56-04:00</updated>

		<published>2005-02-28T07:43:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47046#p47046</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47046#p47046"/>
		<title type="html"><![CDATA[write to file problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47046#p47046"><![CDATA[
if you don't want to append, don't open the file in append mode. AND if you're not going to read from it, ditch that "+"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Feb 28, 2005 7:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sparta]]></name></author>
		<updated>2005-02-28T07:30:21-04:00</updated>

		<published>2005-02-28T07:30:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47044#p47044</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47044#p47044"/>
		<title type="html"><![CDATA[write to file problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47044#p47044"><![CDATA[
I want to replace the channel thats in the file, then over write it with a new channel or channels.. now if i add 1 more channel it ends up like:<br><br>#channel1<br>#channel2<br><br>but i want it to be only 1 line.. so if i type: .bchan #channel1 #channel2<br><br>then it write down the channels to the file bitchchannels.. and that file looks like:<br><br>#channel1 #channel2 <br><br>and thats right, now i type: .bchan #channel3 #channel4<br><br>then the file will look like:<br><br>#channel1 #channel2<br>#channel3 #channel4<br><br>so it just add a new line, how would i replace the existing line with the new one? it should look like:<br><br>#channel3 #channel4<br><br>hope you understand <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=6022">sparta</a> — Mon Feb 28, 2005 7:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-02-28T07:25:48-04:00</updated>

		<published>2005-02-28T07:25:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47043#p47043</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47043#p47043"/>
		<title type="html"><![CDATA[write to file problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47043#p47043"><![CDATA[
If you want to add a new channel, replace your variable which is set to the channel or the &lt;text&gt; after the !trigger with the channel name. I am not sure which one are you talking about.<br><br>I don't think you would need to erase your database file as it has got nothing todo with it, you are just replacing the script to work on another channel.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Feb 28, 2005 7:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sparta]]></name></author>
		<updated>2005-02-28T07:14:00-04:00</updated>

		<published>2005-02-28T07:14:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47042#p47042</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47042#p47042"/>
		<title type="html"><![CDATA[write to file problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47042#p47042"><![CDATA[
I tryed your code, same result.. <br><br>[12:13] Tcl error [set:sbch]: can't read "bitchchannel": no such variable<br><br>------------- EDIT ---------------<br><br>OK, i solved the problem, now to next part.. when i set a new channel, then i want the old one to be replaced with the new value, any way to do this ? or do i have to erase the file, then write a new one?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6022">sparta</a> — Mon Feb 28, 2005 7:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-02-28T06:48:38-04:00</updated>

		<published>2005-02-28T06:48:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47038#p47038</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47038#p47038"/>
		<title type="html"><![CDATA[write to file problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47038#p47038"><![CDATA[
You haven't declared a variable named bitchchannel and yet you are using it in your proc and making it global. First:<br><br>set bitchchannel "i.am.lame"<br><br>Then try it!   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><br><br>And if you combine them it would be something like this, but you already have an error in your previous one so better fix that, before going ahead:<br><div class="codebox"><p>Code: </p><pre><code>proc set:sbch {nick hand text} { global bitchchannel bitchchannels  if {$bitchchannel != ""} {   set r [open $bitchchannels a+]   puts $r "[strftime "%d %b %Y, %H:%M %z"]: $text"   close $r   putlog "Added $text to Bitch channel list."  }    return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Feb 28, 2005 6:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sparta]]></name></author>
		<updated>2005-02-28T05:54:35-04:00</updated>

		<published>2005-02-28T05:54:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47035#p47035</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47035#p47035"/>
		<title type="html"><![CDATA[write to file problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47035#p47035"><![CDATA[
This is the error i get:<br><br>Tcl error [set:sbch]: can't read "bitchchannel": no such variable<br><br>but since the seccond "script" works ok, then the problem must be in the first one, chwr $channels &lt;&lt;-- thats the line i call the proc chwr with.. and if i remove that line, then the seccond script work just fine, it add the var as it should, and no problem..<br><br>I guess the best way is to combine the two scripts, but since i dont have a clue on how to do that i made them separate..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6022">sparta</a> — Mon Feb 28, 2005 5:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-02-28T05:45:09-04:00</updated>

		<published>2005-02-28T05:45:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47034#p47034</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47034#p47034"/>
		<title type="html"><![CDATA[write to file problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47034#p47034"><![CDATA[
What error do you get while executing the first code? Type <strong class="text-strong">.tcl set errorInfo</strong> in DCC to check if there is an error after you have run the script.<br><br>Also make sure you have created the file which has the variable name $bitchchannels and it is in the correct directory as you have mentioned.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Feb 28, 2005 5:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sparta]]></name></author>
		<updated>2005-02-28T05:34:43-04:00</updated>

		<published>2005-02-28T05:34:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47031#p47031</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47031#p47031"/>
		<title type="html"><![CDATA[write to file problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47031#p47031"><![CDATA[
this is what i have so far:<div class="codebox"><p>Code: </p><pre><code>proc chwr {text} { global bitchchannel bitchchannels   set data "$text" if {$bitchchannel != ""} {set r [open $bitchchannels a+]; puts $r "[strftime "%d %b %Y, %H:%M %z"]: $data"; close $r}    putlog "Added $text to Bitch channel list." return 0}</code></pre></div>I know it's not right, but im new to this, so point me in the right direction, and i call the proc from this code:<div class="codebox"><p>Code: </p><pre><code>proc set:sbch {nickc hand text} { global channels  set channels "$text" putlog "S-Bitch channel set to: $channels" chwr $channels}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6022">sparta</a> — Mon Feb 28, 2005 5:34 am</p><hr />
]]></content>
	</entry>
	</feed>
