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

	<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-04-27T05:36:18-04:00</updated>

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

		<entry>
		<author><name><![CDATA[MC_8]]></name></author>
		<updated>2003-04-27T05:36:18-04:00</updated>

		<published>2003-04-27T05:36:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19492#p19492</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19492#p19492"/>
		<title type="html"><![CDATA[Write to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19492#p19492"><![CDATA[
You can open the file for reading and load it all into memory then use llength to get whatever you need.<br><div class="codebox"><p>Code: </p><pre><code>if {![file exists log_file]} {close [open log_file w]} set io [open log_file r]set list ""while {![eof $io]} {  gets $io line  if {[string trim $line] == ""} {continue}  lappend list $line}close $iolappend list "&lt;$nick@$channel&gt; $arg"set st [expr [llength $list]-50]; #assuming you want only the last 50.set list [lrange $list $st end]set io [open log_file w]foreach line $list {  puts $io $line}close $io</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3080">MC_8</a> — Sun Apr 27, 2003 5:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-04-27T02:35:06-04:00</updated>

		<published>2003-04-27T02:35:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19487#p19487</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19487#p19487"/>
		<title type="html"><![CDATA[Write to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19487#p19487"><![CDATA[
that works exelent. but how du i make it so that it cuts of the first line if there is more then a sertan number of lines allready, in the log<p>Statistics: Posted by Guest — Sun Apr 27, 2003 2:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MC_8]]></name></author>
		<updated>2003-04-26T18:11:32-04:00</updated>

		<published>2003-04-26T18:11:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19475#p19475</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19475#p19475"/>
		<title type="html"><![CDATA[Write to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19475#p19475"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pubm - * proc_nameproc proc_name {nick uhost handle channel arg} {  if {![file exists log_file]} {close [open log_file w]}  set io [open log_file a]  puts $io "&lt;$nick@$channel&gt; $arg"  close $io} </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3080">MC_8</a> — Sat Apr 26, 2003 6:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-04-26T16:10:33-04:00</updated>

		<published>2003-04-26T16:10:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19466#p19466</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19466#p19466"/>
		<title type="html"><![CDATA[Write to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19466#p19466"><![CDATA[
bind PUBM - * pubm:logev<br>proc pubm:logev ( nick uhost handle channel text) {<br>        set line1 $line2<br>        set line2 $line3<br>        set line3 $line4<br>        set line4 "$nick: $text"<br>        set fid log.txt [open $fid]<br>        set line $line4<br>        puts $fid $line<br>        catch {close $fid}<br>}<br><br><br>whats wrong ??... this is quite of a guess so dont flame me if i have done a realy "n00b n00b" misstake<p>Statistics: Posted by Guest — Sat Apr 26, 2003 4:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-04-26T15:47:41-04:00</updated>

		<published>2003-04-26T15:47:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19465#p19465</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19465#p19465"/>
		<title type="html"><![CDATA[Write to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19465#p19465"><![CDATA[
humm... maby its me that realy stupid and missed somthing u just wrote or u missed out the part were i need to typ in what file i whant to open =P<p>Statistics: Posted by Guest — Sat Apr 26, 2003 3:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-04-26T15:31:14-04:00</updated>

		<published>2003-04-26T15:31:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19463#p19463</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19463#p19463"/>
		<title type="html"><![CDATA[Write to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19463#p19463"><![CDATA[
thx alot mate<p>Statistics: Posted by Guest — Sat Apr 26, 2003 3:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-04-25T19:07:07-04:00</updated>

		<published>2003-04-25T19:07:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19428#p19428</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19428#p19428"/>
		<title type="html"><![CDATA[Write to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19428#p19428"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>##open the file for writingset fid [open $fid]##set the line to put into the fileset line "This line into the file"##put the line into the fileputs $fid $line##close the filecatch {close $fid}</code></pre></div>Read some tutorial or the TCL manual <a href="http://tcl.activestate.com/man/tcl8.4/TclCmd/contents.htm" class="postlink">http://tcl.activestate.com/man/tcl8.4/T ... ntents.htm</a> to get more info about how to open the file for reading/appending... etc<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Fri Apr 25, 2003 7:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-04-25T16:22:25-04:00</updated>

		<published>2003-04-25T16:22:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19422#p19422</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19422#p19422"/>
		<title type="html"><![CDATA[Write to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19422#p19422"><![CDATA[
how du i write things to a file ?...<br>i need to make a log script and that preety mutch the only thing i need to know =)<p>Statistics: Posted by Guest — Fri Apr 25, 2003 4:22 pm</p><hr />
]]></content>
	</entry>
	</feed>
