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

	<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>2004-06-20T14:49:09-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-06-20T14:49:09-04:00</updated>

		<published>2004-06-20T14:49:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37644#p37644</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37644#p37644"/>
		<title type="html"><![CDATA[Fix]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37644#p37644"><![CDATA[
I solved the problem on my own:<br><br>I had to use this:<div class="codebox"><p>Code: </p><pre><code>puts -nonewline $saveme $visitors</code></pre></div>instead of<div class="codebox"><p>Code: </p><pre><code>puts $saveme $visitors</code></pre></div><p>Statistics: Posted by Guest — Sun Jun 20, 2004 2:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-06-20T03:45:07-04:00</updated>

		<published>2004-06-20T03:45:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37633#p37633</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37633#p37633"/>
		<title type="html"><![CDATA[Problems with my small script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37633#p37633"><![CDATA[
yeah, thx, the filecreation is working now. But there's still the problem with the cryptic sign that is exported into the file instead of the visitor-number.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"> <br><div class="codebox"><p>Code: </p><pre><code>proc nc_join { nick host hand chan } {set visitors [llength [chanlist $chan]]#puthelp "PRIVMSG $chan : $visitors"set saveme [open "users.txt" w] puts $saveme $visitors &lt;&lt; Mistake must be here, I think. close $saveme}</code></pre></div>The Logfile doesn't report any error, so where's my mistake?<p>Statistics: Posted by Guest — Sun Jun 20, 2004 3:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2004-06-19T19:28:04-04:00</updated>

		<published>2004-06-19T19:28:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37624#p37624</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37624#p37624"/>
		<title type="html"><![CDATA[Problems with my small script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37624#p37624"><![CDATA[
This be of some help?<div class="codebox"><p>Code: </p><pre><code># Create the storage file for users.if {![file exists "users.txt"]} { set none [open "users.txt" w] close $none unset none if {![file exists "users.txt"]} {  putlog "*** (notes) ERROR: Unable to write to \"users.txt\" ***"  return 0 }}</code></pre></div><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=3646">Alchera</a> — Sat Jun 19, 2004 7:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-06-19T14:47:20-04:00</updated>

		<published>2004-06-19T14:47:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37615#p37615</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37615#p37615"/>
		<title type="html"><![CDATA[Problems with my small script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37615#p37615"><![CDATA[
I shrinked the script a little bit, but there's still the problem with the filecreation in <strong class="text-strong">line7</strong>, I always get a file with just a cryptic sign in it. If I replace line 15-17 with the comment-line, the script works fine but of course then it doesn't export the number into the file <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":-(" title="Sad"><div class="codebox"><p>Code: </p><pre><code>bind join -|- * nc_joinbind part -|- * nc_joinbind sign -|- * nc_joinif {![file exists users.txt]} { set none [open "users.txt" "w"] puts $none "" close $none}proc nc_join { nick host hand chan } {set visitors [llength [chanlist $chan]]#puthelp "PRIVMSG $chan : $visitors"set saveme [open "users.txt" "a"]puts $saveme $visitors close $saveme}</code></pre></div><p>Statistics: Posted by Guest — Sat Jun 19, 2004 2:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-06-19T09:43:13-04:00</updated>

		<published>2004-06-19T09:43:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37595#p37595</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37595#p37595"/>
		<title type="html"><![CDATA[Problems with my small script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37595#p37595"><![CDATA[
hmm, I think my problem is writing something into a file, <div class="codebox"><p>Code: </p><pre><code>puts $none "0"</code></pre></div>because the script doesn't write the 0 into the file although this has nothing to do with the binds. Is there an other possibility to put a number into a file?<p>Statistics: Posted by Guest — Sat Jun 19, 2004 9:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-06-19T08:45:07-04:00</updated>

		<published>2004-06-19T08:45:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37593#p37593</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37593#p37593"/>
		<title type="html"><![CDATA[Problems with my small script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37593#p37593"><![CDATA[
Here try these scripts.<br>The main thing is to get the total channel users on the binds<br>of join, part, quit or when a netsplit occurs maybe.<br><br>Here are some scripts pre ready which do almost the same<br>thing, you can have an idea by maybe seeing their codes.<br><br><a href="http://www.egghelp.org/tclhtml/3478-4-0-0-1-channel-peak.htm" class="postlink">http://www.egghelp.org/tclhtml/3478-4-0 ... l-peak.htm</a><br><br>The first script I think will do the job for you in this result.<br>All scripts normally store channel peak users such as I have<br>a channel kick counter for my bot in .txt files myself.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sat Jun 19, 2004 8:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-06-19T07:21:58-04:00</updated>

		<published>2004-06-19T07:21:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37588#p37588</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37588#p37588"/>
		<title type="html"><![CDATA[Problems with my small script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37588#p37588"><![CDATA[
Hi all,<br><br>I am very new in programming with Tcl and Eggdrop. I wanted to write a script, that writes the current number of users of a channel in a textfile.<br>Everytime a user joins the channel, the script opens the file "users.txt" and adds 1 to the existing number. And when a user leaves the channel, it substracts 1. But the script doesn't work, there's only a linefeed in the textfile. Where's my fault?<br><br>Here's my script:<div class="codebox"><p>Code: </p><pre><code>set channel "#channel"bind join - * nc_join bind part - * nc_leave bind sign - * nc_leave if {![file exists users.txt]} { set none [open "users.txt" "w"] puts $none "0" close $none}proc nc_join { nick host hand chan } {  if {$chan == $channel} {set in [open "users.txt" "r"]gets $in in_valclose $inincr $in_val +1set out [open "users.txt" "w"]puts $out $in_valclose $out  }}proc nc_leave { nick host hand chan } {  if {$chan == $channel} {set in2 [open "users.txt" "r"]gets $in2 in_val2close $in2incr $in_val2 -1set out2 [open "users.txt" "w"]puts $out2 $in_val2close $out2  }}</code></pre></div><p>Statistics: Posted by Guest — Sat Jun 19, 2004 7:21 am</p><hr />
]]></content>
	</entry>
	</feed>
