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

	<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>2009-11-13T21:30:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-13T21:30:50-04:00</updated>

		<published>2009-11-13T21:30:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90901#p90901</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90901#p90901"/>
		<title type="html"><![CDATA[Puts not working o_O]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90901#p90901"><![CDATA[
Should work like that, assuming you havn't already opened $::satielfile for writing without closing it earlier.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Nov 13, 2009 9:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[henasraf]]></name></author>
		<updated>2009-11-13T21:06:41-04:00</updated>

		<published>2009-11-13T21:06:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90899#p90899</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90899#p90899"/>
		<title type="html"><![CDATA[Puts not working o_O]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90899#p90899"><![CDATA[
Yeah... still not working. Same goes for another script of mine, too. Should be simple, but noooooooooo....<div class="codebox"><p>Code: </p><pre><code>proc henasraf:satiel:add { nick host hand chan text } {    if { $text != "" } {        set fopen [open $::satielfile a]        puts $fopen $text        close $fopen        putmsg $chan "Added &lt;$text&gt; to Satiels database"    }}</code></pre></div>Sends the message to the channel but doesn't actually do anything to the file. $::satielfile refers to the right file path/name. Not a problem with the variable, it works fine for reading from the file. Iunno what to do |:<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10934">henasraf</a> — Fri Nov 13, 2009 9:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-11-03T14:47:21-04:00</updated>

		<published>2009-11-03T14:47:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90783#p90783</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90783#p90783"/>
		<title type="html"><![CDATA[Puts not working o_O]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90783#p90783"><![CDATA[
Just to confirm raider2k's suspicions; since you don't close the file, the output will never be flushed to the file, as tcl buffers file operations by default.<br><br>Further, invoking this proc over and over will "leak" file handlers, up until the point (usually around 1023 file handlers) where you have exhausted the available resources, and your eggdrop will be unable to open any other files or network connections.<br><br>Tcl does not come with a garbage collector, so you'll have to take the effort of keeping track/cleaning up your resources such as file handles and sockets yourself. The only cleanup done is the anonymous namespace of the proc itself (local variables will be removed as the proc ends).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Nov 03, 2009 2:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-11-03T07:42:29-04:00</updated>

		<published>2009-11-03T07:42:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90776#p90776</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90776#p90776"/>
		<title type="html"><![CDATA[Puts not working o_O]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90776#p90776"><![CDATA[
combining different things seem fine in order to shorten code and make it a bit faster, but definately hard to read - even if you are looking for an error.<br><br>my guess: <br><br>the channel which is being opened up with open isnt being closed, maybe you also would like to put in putlogs after each line to see where it stops working, explode the following part into different lines:<br><div class="codebox"><p>Code: </p><pre><code>puts [open "$nogreetpath\\nogreet.txt" a] $nick</code></pre></div>in example:<div class="codebox"><p>Code: </p><pre><code>set filename "$nogreetpath/nogreet.txt"set file [open $filename a]puts $file $nickclose $file</code></pre></div>Im kind of wondering why you are using \\ since I always used / to separate different directories from each other, works even on windows based systems. and $file (in my case) already exists I guess since you are reading from it as well?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Tue Nov 03, 2009 7:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[henasraf]]></name></author>
		<updated>2009-11-03T06:52:30-04:00</updated>

		<published>2009-11-03T06:52:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90774#p90774</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90774#p90774"/>
		<title type="html"><![CDATA[Puts not working o_O]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90774#p90774"><![CDATA[
I've used puts a fair amount of times, not once has it cause this.<br>I get no error at all; the file exists, all the variables it needs exist and contain the right contents; but the file just doesn't get written to.<div class="codebox"><p>Code: </p><pre><code>proc spidey:settings:greet { nick host hand chan text } {        global nogreetpath        if { [lindex $text 0] == "off" } {        set nicklist [split [read -nonewline [open "$nogreetpath\\nogreet.txt" r]] "\n"]        if { [lsearch $nicklist $nick] == -1 } {            puts [open "$nogreetpath\\nogreet.txt" a] $nick        }        putnotc $nick "You will no longer be greeted when you enter a channel with me in it."        putnotc $nick "Type \002!setting greet on\002 to be greeted again."    } elseif { [lindex $text 0] == "on" } {        set foundnick 0        set nicklist [split [read -nonewline [open "$nogreetpath\\nogreet.txt" r]] "\n"]        while { [lsearch $nicklist $nick] != -1 } {            set index [lsearch $nicklist $nick]            set nicklist [lreplace $nicklist $index $index]        }        puts [open "$nogreetpath\\nogreet.txt" w] [join $nicklist "\n"]        putnotc $nick "You will be greeted every time you enter a channel with me in it."        putnotc $nick "Type \002!setting greet off\002 to stop being greeted."    } else {        putnotc $nick "Invalid setting. Must be \002on|off\002."    }}</code></pre></div>I put around some putlogs (removed from here) to see that the vars are all correct. They are, and the putlogs execute meaning it's not a conditions problem. The messages also get echoed correctly. Wth is this happening? The "on" setting also works; puts work fine there.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10934">henasraf</a> — Tue Nov 03, 2009 6:52 am</p><hr />
]]></content>
	</entry>
	</feed>
