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

	<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-08-12T14:19:35-04:00</updated>

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

		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-08-12T14:19:35-04:00</updated>

		<published>2009-08-12T14:19:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89857#p89857</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89857#p89857"/>
		<title type="html"><![CDATA[buffer/keep-in-memory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89857#p89857"><![CDATA[
ok<br>let me try that when I have some more time and Im at home again, will keep you updated. thanks again for your quick reply <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=9589">raider2k</a> — Wed Aug 12, 2009 2:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-08-12T12:04:02-04:00</updated>

		<published>2009-08-12T12:04:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89855#p89855</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89855#p89855"/>
		<title type="html"><![CDATA[buffer/keep-in-memory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89855#p89855"><![CDATA[
No, I am talking 'bout tcl-lists... as I've been from the very start. lreplace will replace the specified list items (<strong class="text-strong">not rows</strong>) with whatever values you provide (if any).<div class="codebox"><p>Code: </p><pre><code>set mylist [list "item 1" "item 2" "item 3"]#mylist: {item 1} {item 2} {item 3}lappend mylist "item 4"#mylist: {item 1} {item 2} {item 3} {item 4}set mylist [lreplace mylist 2 2]#mylist: {item 1} {item 2} {item 4}set mylist [lreplace mylist 2 2 "item 3"]#mylist: {item 1} {item 2} {item 3}set mylist [lreplace mylist 2 2 "item 3" "item 4"]#mylist: {item 1} {item 2} {item 3} {item 4}set mylist [lrange $mylist 1 end]#mylist: {item 2} {item 3} {item 4}if {[lsearch $mylist "item 3"]} {  puts stdout "true"}</code></pre></div>Basically, when you get a new news-item, check whether it's already present in the list; if not, add it to the list and announce it, then use lrange or lreplace to remove old entries (you can use the llength command to test the size of the list).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Aug 12, 2009 12:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-08-12T11:50:53-04:00</updated>

		<published>2009-08-12T11:50:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89854#p89854</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89854#p89854"/>
		<title type="html"><![CDATA[buffer/keep-in-memory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89854#p89854"><![CDATA[
looks like im really thinking the wrong way. the vision in my head looks like this:<br><br>first news - news source<br>second news - news source<br>third news - news source<br>fourth news - news source<br>last news - news source<br><br>but from what I have seen now on the tcl docs page reminds me again of the tcl way of lists that looks like this:<br><br>{{first news - news source} {second news - news source} {third news - news source} { fourth news - news source} {last news - news source}}<br><br>as far as I am right<br>so you are saying that lreplace kind of deletes a line when it becomes ""? correct me if I am wrong please <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=9589">raider2k</a> — Wed Aug 12, 2009 11:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-08-12T11:17:28-04:00</updated>

		<published>2009-08-12T11:17:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89853#p89853</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89853#p89853"/>
		<title type="html"><![CDATA[buffer/keep-in-memory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89853#p89853"><![CDATA[
If you think of deleting as replacing one list item with nothing at all, then lreplace can delete an item.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Aug 12, 2009 11:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-08-12T11:07:08-04:00</updated>

		<published>2009-08-12T11:07:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89852#p89852</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89852#p89852"/>
		<title type="html"><![CDATA[buffer/keep-in-memory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89852#p89852"><![CDATA[
looks like I was thinking around the corner ...<br>sounds like a 2go option <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>by the way: theres no command to easily delete a line instead of replacing it? thats what I was always wondering about, because replacing isnt the same as deleting .. or am I thinking in circles again?<br><br>edit:<br>persistent as long as the eggdrop is running I think should be enough as it i quite stable<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Wed Aug 12, 2009 11:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-08-12T10:29:46-04:00</updated>

		<published>2009-08-12T10:29:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89851#p89851</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89851#p89851"/>
		<title type="html"><![CDATA[buffer/keep-in-memory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89851#p89851"><![CDATA[
The first question would be the persistence of the stored information; should it be valid for the session the eggdrop is running, or should it persist in between crashes/restarts/reboots?<br><br>The simplest approach in my mind, would be to use tcl-lists;<br>Use lappend to add a new item to the list, lsearch to test whether the list contains an item, and lrange or lreplace to remove old items. This, however, will only persist while your eggdrop is running and not restarted. For longer persistence you'll need some kind of database storage (files or other).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Aug 12, 2009 10:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-08-12T10:13:53-04:00</updated>

		<published>2009-08-12T10:13:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89850#p89850</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89850#p89850"/>
		<title type="html"><![CDATA[buffer/keep-in-memory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89850#p89850"><![CDATA[
I would like to work on a system that is gathering news from two different news channels on an irc network and then announce the news to one of my own news channels. after thinking about a solution for some time it came to mind that duplicate announcing to my channel could happen, but should not.<br><br>is there a way to put the last 20 news into some kind of memory that is being kept in a global list which can be compared with new incoming news? in example a list containing the news source, the news title and the date. would mean, if new news found in list, dont announce it to my channel, if news not found, announce it.<br><br>was thinking about arrays already but - either its me or theres really no way to do it - I was not able to find anything to limit the lists maximum size (eg: maximum 20 news to be kept where the oldest news entry gets deleted - automatically or manually, doesnt matter so far).<br><br>and also was i thinking of working with files - to be honest, if theres a choice I wouldnt want to use files because it seems to unhandy to me.<br><br>looking forward to constructive help <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>and much thanks in advance<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Wed Aug 12, 2009 10:13 am</p><hr />
]]></content>
	</entry>
	</feed>
