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

	<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-11-23T15:41:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-11-23T15:41:12-04:00</updated>

		<published>2006-11-23T15:41:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68369#p68369</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68369#p68369"/>
		<title type="html"><![CDATA[White lines in textfile after write]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68369#p68369"><![CDATA[
wouldnt just<div class="codebox"><p>Code: </p><pre><code>proc save:deaud {} {   set a [open "deaud.txt" w]      puts -nonewline $a [join $::deauds \n]   close $a}</code></pre></div>do the trick?<br><br>PS: I would move "[close $file]" to the next line and remove [] braces. close is not suposed to return anything but an empty string, but I still wouldn't add a probably empty string to something I want to parse as a consident list.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Thu Nov 23, 2006 3:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-21T15:02:10-04:00</updated>

		<published>2006-11-21T15:02:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68294#p68294</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68294#p68294"/>
		<title type="html"><![CDATA[White lines in textfile after write]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68294#p68294"><![CDATA[
You split the line twice, once again with the foreach..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Tue Nov 21, 2006 3:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[QQleQ]]></name></author>
		<updated>2006-11-21T00:27:26-04:00</updated>

		<published>2006-11-21T00:27:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68270#p68270</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68270#p68270"/>
		<title type="html"><![CDATA[White lines in textfile after write]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68270#p68270"><![CDATA[
Hmz, for some reason that aint working<br><br>the text file now looks like this:<br><div class="codebox"><p>Code: </p><pre><code>Zinloos GewelddeadscriptswerkoverlegmaczutloppieNewlinesHet oude god-scriptTiefusLineBreaks</code></pre></div>Where the newly added lines are added from loppie (with this script) (the older lines where manually added with vi)<br><br>The script now looks like this:<div class="codebox"><p>Code: </p><pre><code>bind pub - !deaud add:deaudset deauds [split [read [set file [open "deaud.txt"]]] \n][close $file]unset fileset god [split [read [set file [open "god.txt"]]] \n][close $file]unset fileproc add:deaud {n u h c a} { global deauds global god if { [set b [split $a]] != "" } { if {[lsearch -exact $deauds [set b [split $a]]] == -1} { if {[lsearch -exact $god [set b [split $a]]] == -1} {  lappend deauds $b  putmsg $c "$b toegevoegd aan de deaudenlijst."  save:deaud } {  putmsg $c "$b staat al op de godenlijst." } } {  putmsg $c "$b staat al op de deaudenlijst." } } {    set qot_fd [open "deaud.txt" r]    for {set qot_cnt 0} { ![eof $qot_fd] } { incr qot_cnt } {        gets $qot_fd qot_list($qot_cnt)    }    close $qot_fd    set qot_cnt [expr $qot_cnt - 2]    set qot_sel $qot_list([set qot_cur [rand [expr $qot_cnt + 1]]])    putmsg $c "$qot_sel moet deaud. ([expr $qot_cur + 1] van [expr $qot_cnt + 1])" }}proc save:deaud {} {set a [open "deaud.txt" w]foreach line [split $::deauds \n] {   if {$line != "" &amp;&amp; $line != "\n"} {    puts $a [join $line \n]   }} close $a}</code></pre></div>What am i doing wrong?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8408">QQleQ</a> — Tue Nov 21, 2006 12:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-20T23:32:02-04:00</updated>

		<published>2006-11-20T23:32:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68267#p68267</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68267#p68267"/>
		<title type="html"><![CDATA[White lines in textfile after write]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68267#p68267"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>foreach bn $::deauds {  puts $a [join $bn \n] } </code></pre></div>Should do it..<br><br>I'd also put in a <div class="codebox"><p>Code: </p><pre><code>if {$bn != ""} {    puts $a [join $bn \n]}</code></pre></div>so its not saving blank lines..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Mon Nov 20, 2006 11:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[QQleQ]]></name></author>
		<updated>2006-11-20T22:09:03-04:00</updated>

		<published>2006-11-20T22:09:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68265#p68265</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68265#p68265"/>
		<title type="html"><![CDATA[White lines in textfile after write]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68265#p68265"><![CDATA[
Hi there<br><br>All this script does is writing sentences or words to a textfile.. if its not in either deaud.txt or god.txt already.<br><br>Its working like a charm, however, i cant seem to get rid of some strange white lines (line breaks) in the text file. They keep comming back, even though i edit them out using vi.<br><br>Help apreciated.<br><div class="codebox"><p>Code: </p><pre><code>bind pub n !deaud add:deaudset deauds [split [read [set file [open "deaud.txt"]]] \n][close $file]unset fileset god [split [read [set file [open "god.txt"]]] \n][close $file]unset fileproc add:deaud {n u h c a} { global deauds global god if { [set b [split $a]] != "" } { if {[lsearch -exact $deauds [set b [split $a]]] == -1} { if {[lsearch -exact $god [set b [split $a]]] == -1} {  lappend deauds $b  putmsg $c "$b toegevoegd aan de deaudenlijst."  save:deaud } {  putmsg $c "$b staat al op de godenlijst." } } {  putmsg $c "$b staat al op de deaudenlijst." } } {    set qot_fd [open "deaud.txt" r]    for {set qot_cnt 0} { ![eof $qot_fd] } { incr qot_cnt } {        gets $qot_fd qot_list($qot_cnt)    }    close $qot_fd    set qot_cnt [expr $qot_cnt - 2]    set qot_sel $qot_list([set qot_cur [rand [expr $qot_cnt + 1]]])    putmsg $c "$qot_sel moet deaud. ([expr $qot_cur + 1] van [expr $qot_cnt + 1])" }}proc save:deaud {} { set a [open "deaud.txt" w] foreach bn $::deauds {  puts $a $bn } close $a}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8408">QQleQ</a> — Mon Nov 20, 2006 10:09 pm</p><hr />
]]></content>
	</entry>
	</feed>
