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

	<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>2011-05-04T19:59:28-04:00</updated>

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

		<entry>
		<author><name><![CDATA[outthere]]></name></author>
		<updated>2011-05-04T19:59:28-04:00</updated>

		<published>2011-05-04T19:59:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96825#p96825</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96825#p96825"/>
		<title type="html"><![CDATA[thanks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96825#p96825"><![CDATA[
I have been looking for something like this. Thanks. I notice though when you !delnews 6 out of 10 for example it counts backward so it in fact deletes the 4th one. <br>Is it just me?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7035">outthere</a> — Wed May 04, 2011 7:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DiEPLZ]]></name></author>
		<updated>2010-05-12T01:41:17-04:00</updated>

		<published>2010-05-12T01:41:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93082#p93082</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93082#p93082"/>
		<title type="html"><![CDATA[News.tcl Adding/Deleting/Reading news items from/into a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93082#p93082"><![CDATA[
Script is doing its work!<br><br>I was almost submitting something totally different here, though <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":-)" title="Smile"><br><br>Cause I had some error while chansetting my chan for +snews, although I killed the eggdrop and reloaded it afterwards and it is now working like a charm!<br><br>Many thanks! Really much appreciated!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11027">DiEPLZ</a> — Wed May 12, 2010 1:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2010-05-11T15:44:42-04:00</updated>

		<published>2010-05-11T15:44:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93079#p93079</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93079#p93079"/>
		<title type="html"><![CDATA[News.tcl Adding/Deleting/Reading news items from/into a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93079#p93079"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Author: tomekk                                                                          # e-mail:  tomekk/@/oswiecim/./eu/./org                                                                      # home page: http://tomekk.oswiecim.eu.org/#                                                                                                    # Version 0.1 #                                                         # This file is Copyrighted under the GNU Public License.# http://www.gnu.org/copyleft/gpl.html # if you want to use commands from this script on your chan, type in eggdrop console (via telnet or DCC chat)    # .chanset #channel_name +snews       # and later .save # how many last news to showset newsnr 3# file with newsset newsdb "news.db"#########################################################bind pub -|- !news show_newsbind pub -|- !addnews add_newsbind pub -|- !delnews del_newssetudef flag snewsif {[file exists $newsdb] == 0} {                                                                               set new_db [open $newsdb w]puts $new_db "news 1\nnews 2\nnews 3"close $new_db}                                         proc get_news { } {global newsdbset get_data [open $newsdb r]set all_news [split [read $get_data] "\n"]close $get_datareturn $all_news}proc show_news { nick uhost hand chan arg } {global newsnrif {![channel get $chan snews]} {return}set cmd [lindex [split $arg] 0]set news_list [get_news]set news_len [expr [llength $news_list] - 1]if {$cmd == ""} {if {$news_len &gt; 0} {set news_counter 1for {set i $news_len} {$i &gt; [expr $news_len - $newsnr]} {set i [expr $i - 1]}  {if {$i &gt; 0} {putquick "PRIVMSG $chan :$news_counter: [lindex $news_list [expr $i - 1]]"incr news_counter 1}}} {putquick "PRIVMSG $chan :News file is empty."}} elseif {$cmd == "count"} {putquick "PRIVMSG $chan :Total news in file: $news_len"}}proc add_news { nick uhost hand chan arg } {global newsdbif {![channel get $chan snews]} {return}if {[string trim $arg] != ""} {set write_to_file [open $newsdb a]puts $write_to_file $argclose $write_to_fileputquick "PRIVMSG $chan :The news item has been added."}}proc del_news { nick uhost hand chan arg } {global newsdbif {![channel get $chan snews]} {return}set arg [string trim $arg]if {$arg == "all"} {set clean_db [open $newsdb w]close $clean_dbputquick "PRIVMSG $chan :All news items have been deleted."} {set in_args [split $arg]set numbers [list]foreach in_arg $in_args {if {[regexp {^([0-9]+)$} $in_arg]} {if {$in_arg &gt; 0} {set del_nr [expr $in_arg - 1]lappend numbers $del_nr}}}if {[llength $numbers] &gt; 0} {set the_news [get_news]set the_number [llength $the_news]if {$the_number &gt; 0 } {set rewrite_db [open $newsdb w]for {set i 0} {$i &lt; $the_number} {incr i 1} {if {[lsearch $numbers $i] == -1} {set the_line [lindex $the_news $i]if {$the_line != ""} {puts $rewrite_db $the_line}} {putquick "PRIVMSG $chan :Item [expr $i + 1] has been deleted"}}close $rewrite_db}}}}putlog "simple-news.tcl ver 0.1 by tomekk loaded"</code></pre></div>i've made tiny fix to my other script<br><br>!news - shows news<br>!news count - counts the news<br><br>!addnews &lt;news&gt; - adds the news<br><br>!delnews X X X X - removes the news (easier without , ;p)<br>!delnews all - removes all news<br><br>try it<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Tue May 11, 2010 3:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DiEPLZ]]></name></author>
		<updated>2010-05-11T07:15:12-04:00</updated>

		<published>2010-05-11T07:15:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93078#p93078</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93078#p93078"/>
		<title type="html"><![CDATA[News.tcl Adding/Deleting/Reading news items from/into a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93078#p93078"><![CDATA[
The thing is i'm not root on the shell and root dont wanna install any sql stuff <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":-(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11027">DiEPLZ</a> — Tue May 11, 2010 7:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2010-05-11T06:54:10-04:00</updated>

		<published>2010-05-11T06:54:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93076#p93076</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93076#p93076"/>
		<title type="html"><![CDATA[News.tcl Adding/Deleting/Reading news items from/into a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93076#p93076"><![CDATA[
I would rather use <a href="http://www.sqlite.org/" class="postlink">sqlite3</a> to store stuff in than reinvent the wheel and store them in a text file. <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=187">caesar</a> — Tue May 11, 2010 6:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DiEPLZ]]></name></author>
		<updated>2010-05-11T06:09:37-04:00</updated>

		<published>2010-05-11T06:09:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93075#p93075</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93075#p93075"/>
		<title type="html"><![CDATA[News.tcl Adding/Deleting/Reading news items from/into a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93075#p93075"><![CDATA[
Hi all,<br><br>last time I requested a script here, arfer made me a fine script wich look up stuff on pricewatch (<a href="http://www.tweakers.net/pricewatch" class="postlink">http://www.tweakers.net/pricewatch</a>) see the script @ <a href="http://forum.egghelp.org/viewtopic.php?t=17457&amp;highlight=pricewatch" class="postlink">http://forum.egghelp.org/viewtopic.php? ... pricewatch</a><br><br>Arfer still many thanks for this! i'm using it allot.<br><br>Anyway i'm looking for a pretty simple news script, wich I couldnt find in the archive or on google<br><br>This is what the script must be able todo:<br><br>!addnews &lt;news&gt; - wich result in adding the &lt;news&gt; in a simple .txt file in /scripts/news.txt (every news item on a new line)<br>!delnews &lt;1,2,3 - all&gt; - wich result in deleting line 1,2,3 or all (would be neat if you could delete line 1, 4 and 13, without deleting the rest)<br>!news - wich result the eggdrop to announce last 3 or 5 (perhaps editable) news lines<br><br>a nice feature would be if the eggdrop announce something like: <br>!news<br>&lt;@bot&gt; 1: this script is awesome<br>&lt;@bot&gt; 2: Another fine script is made<br><br>!delnews 2<br>&lt;@bot&gt; Item 2 has been deleted<br><br>!delnews all<br>&lt;@bot&gt; All news items has been deleted<br><br>!addnews this site is the best<br>&lt;@bot&gt; The news item has been<br><br>I've tried user_news, wich is asking for nickserv identification, wich isnt an option <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":-(" title="Sad"><br>I've tried news_1.01, wich didnt created news ;(<br>I've tried holm_news wich couldnt get others, except for shell user, to add hosts thru irc<br><br>So if someone has a script like this allready; pls gimme a link<br>otherwise I would be very honoured if someone is able to make such a script for me<br><br>Many thanks in advance<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11027">DiEPLZ</a> — Tue May 11, 2010 6:09 am</p><hr />
]]></content>
	</entry>
	</feed>
