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

	<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-07-05T09:35:20-04:00</updated>

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

		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2005-07-05T09:35:20-04:00</updated>

		<published>2005-07-05T09:35:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51810#p51810</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51810#p51810"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51810#p51810"><![CDATA[
I wasn't talking about the brackets i was talking about what you used for llength.<br><br>When you get the errormessage<br><br>should be llength list it means use [llength &lt;LIST&gt;]<br>Not [llength list &lt;LIST&gt;].<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Tue Jul 05, 2005 9:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-07-05T02:54:20-04:00</updated>

		<published>2005-07-05T02:54:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51797#p51797</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51797#p51797"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51797#p51797"><![CDATA[
<blockquote class="uncited"><div>.<br><br>You should go through the tcl-commands.doc BEFORE you ask us to fix your code. </div></blockquote>Well, i cant remember that in TCL-documents the way too place brackets is getting explained.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"> <br><br>Well i shall see if i cant find a good guide or manual about placing brackets, <br><br>sry for the question  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Tue Jul 05, 2005 2:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2005-07-05T01:40:18-04:00</updated>

		<published>2005-07-05T01:40:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51791#p51791</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51791#p51791"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51791#p51791"><![CDATA[
It's because you've made it all wrong, what are you using brackets for?<br><div class="codebox"><p>Code: </p><pre><code>if {[llength [chanlist $chan] &lt; $setting(minusers) -&gt;&gt;&gt; ] &lt;&lt;&lt;-} { </code></pre></div>That's one of the useless brackets not supposed to be in there<br><div class="codebox"><p>Code: </p><pre><code>{[llength list [[chanlist $chan] &lt; $setting(minusers)]]} {</code></pre></div>Now you've done it again and added more useless brackets not to mention list?!<br>Not to mention do it all wrong.<br><br>You should go through the tcl-commands.doc BEFORE you ask us to fix your code. <br><br><br><br><br>PS:<div class="codebox"><p>Code: </p><pre><code>if {[llength [chanlist $chan]] &lt; $setting(minusers)} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Tue Jul 05, 2005 1:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-07-05T00:51:21-04:00</updated>

		<published>2005-07-05T00:51:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51790#p51790</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51790#p51790"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51790#p51790"><![CDATA[
I know the peice of code Sir_Fz had made. is not the problem maker, the peice of code that count the users of a channel is not right, butt i can figger out what cause the usercount is being used by me in another script and it is not given any troubles<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Tue Jul 05, 2005 12:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-07-04T13:52:23-04:00</updated>

		<published>2005-07-04T13:52:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51769#p51769</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51769#p51769"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51769#p51769"><![CDATA[
Well having this problem now<br><div class="codebox"><p>Code: </p><pre><code>set file "home/warseeker/channels/chanfile"set setting(minusers) "15"set setting(privechan) "#warseeker.prive"bind pub m|m !gc global:checkproc global:check {nick uhost hand chan text} {foreach chan [channels] {check:forward $chan }}proc check:forward {chan} { global file settingif {[llength [chanlist $chan] &lt; $setting(minusers)]} {set exists 0 set chan [lindex [split $arg] 0] foreach temp [split [string tolower [read [set inf [open $file]]]] "\n"][close $inf] { if {[string equal -nocase [lindex [split $temp] 0] $chan]} { set exists 1 break } } if {$exists} { set z "" set a [open $file r] while {![eof $a]} { set b [gets $a] if {![string equal -nocase [lindex $b 0] $chan]} { lappend z ${b} } } close $a set n [open $file w] foreach k $z { if {$k != ""} { puts $n $k } } close $n putlog "Deleted $chan from file." puthelp "MSG $setting(privechan) : $chan was deleted, the channel was not having enough users"utimer 5 [list remove channel $chan]utimer 7 [list savechannels]} { putlog "ERROR $chan not found in chanlist" } }}</code></pre></div>Error : Tcl error [global:check]: wrong # args: should be "llength list"<br><br>When i rewite the script and make it <br><div class="codebox"><p>Code: </p><pre><code>{[llength list [[chanlist $chan] &lt; $setting(minusers)]]} {</code></pre></div>it returns all the names off the users on that channel with the msg <br>Tcl error [global:check]: invalid command name, (and all the names)<br><br>So i guess this is not right, i tried a little more things butt then the code i complety messed up, <br><br>Can you guys give me some help ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Mon Jul 04, 2005 1:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-07-04T09:16:15-04:00</updated>

		<published>2005-07-04T09:16:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51747#p51747</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51747#p51747"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51747#p51747"><![CDATA[
Well, it are only channel names of requested channels, dont know if this will take up much memory. <br><br>Butt you mean i should use listing insted of file readind and save this too a file i a part of a day like every 45 min ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Mon Jul 04, 2005 9:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-07-03T14:08:42-04:00</updated>

		<published>2005-07-03T14:08:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51727#p51727</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51727#p51727"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51727#p51727"><![CDATA[
on a side note, if you are not severely restricted with memory usage (almost never the case with scripts), you better slurp all data from your data file at once, do all data manipulation in memory (that would typically be list &amp; array manipulation), and periodically save all data to the file - as opposed to manipulating data inside files, which of course is slower &amp; more complex<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sun Jul 03, 2005 2:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-07-03T13:25:25-04:00</updated>

		<published>2005-07-03T13:25:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51726#p51726</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51726#p51726"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51726#p51726"><![CDATA[
that could be a good idea, i will check if bol.com has some good books about TCL scripting<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Sun Jul 03, 2005 1:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-07-03T13:09:53-04:00</updated>

		<published>2005-07-03T13:09:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51725#p51725</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51725#p51725"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51725#p51725"><![CDATA[
you better buy a <a href="http://wiki.tcl.tk/57" class="postlink">book</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sun Jul 03, 2005 1:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-07-03T11:49:38-04:00</updated>

		<published>2005-07-03T11:49:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51724#p51724</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51724#p51724"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51724#p51724"><![CDATA[
thx Sir_Fz, for the code. <br><br>You know a good site where i can learn these things, because im dieing too learn TCL in a advanced way ??<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Sun Jul 03, 2005 11:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-07-03T08:15:04-04:00</updated>

		<published>2005-07-03T08:15:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51708#p51708</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51708#p51708"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51708#p51708"><![CDATA[
This proc should delete the name only if it exists:<div class="codebox"><p>Code: </p><pre><code>proc rem:chan {arg} { global file set exists 0 set chan [lindex [split $arg] 0] foreach temp [split [string tolower [read [set inf [open $file]]]] "\n"][close $inf] {  if {[string equal -nocase [lindex [split $temp] 0] $chan]} {    set exists 1   break  } } if {$exists} {  set z ""  set a [open $file r]  while {![eof $a]} {   set b [gets $a]   if {![string equal -nocase [lindex $b 0] $chan]} { lappend z ${b} }  }  close $a  set n [open $file w]  foreach k $z {   if {$k != ""} { puts $n $k }  }  close $n  putlog "Deleted $chan from file."  } {  putlog "$chan does not exist in file." }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Jul 03, 2005 8:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-07-03T06:23:30-04:00</updated>

		<published>2005-07-03T06:23:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51701#p51701</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51701#p51701"/>
		<title type="html"><![CDATA[Deleting names in files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51701#p51701"><![CDATA[
Hello, i have a little question.<br><br>The script im working on saves channels names too a file, <br>When the script its doing its job, it saves channels names too a files (writing) and it checkes of the channel name is already in there.<br><br>Butt my problem is how too delete a channelname, he has too search for it in a file that may contain like 100 channelnames and delete the one matching the channelname i like too erase from the file.<br><br>I have read suninet.nl for basic file working, butt the supject doenst coem forward in that Guide.<br><br>You guys have a Guide for me, or just the code you gave too use for this <br><br>Verry much thx's  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Sun Jul 03, 2005 6:23 am</p><hr />
]]></content>
	</entry>
	</feed>
