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

	<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-05-03T13:58:42-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-05-03T13:58:42-04:00</updated>

		<published>2005-05-03T13:58:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48954#p48954</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48954#p48954"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48954#p48954"><![CDATA[
I need exactly the same now... How can one do it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Tue May 03, 2005 1:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ElZeRo]]></name></author>
		<updated>2005-04-11T13:06:47-04:00</updated>

		<published>2005-04-11T13:06:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48016#p48016</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48016#p48016"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48016#p48016"><![CDATA[
Hi there ... <br><br>Iwe Testet it too -... Working 100% with a txt file ... what changes are needed so that the script can read out "php" scripts  --- i could use it togehter with my Ut2004 server Script .. (eggdrop dossn't support UDP direct) ... so i have "this" <a href="http://www.elzero.dk/query/index.php" class="postlink">http://www.elzero.dk/query/index.php</a> that has all INFO's that i need  ... But how do i convert them into "eggdrop" ??? ... And I dont NEED everything there <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":-)" title="Smile"> ... Only "Map name", "server ip", "number of players" , "max players" and "server ip".<br><br>Regards <br> ElZeRo<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6092">ElZeRo</a> — Mon Apr 11, 2005 1:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-03-18T10:31:30-04:00</updated>

		<published>2005-03-18T10:31:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47851#p47851</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47851#p47851"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47851#p47851"><![CDATA[
<blockquote class="uncited"><div>Turns out .txt files are sendt as part of the header...</div></blockquote>They're not... but egghttp.tcl looks for a "&lt;" to detect the end of the header. (because connections made using "connect" can't recieve the empty line that denotes the end of the header)<br>If your text contains a "&lt;" some where in the middle, the contents will be split at that point (every line including the first one with a "&lt;" in it ends up in the body)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Mar 18, 2005 10:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-03-18T09:52:54-04:00</updated>

		<published>2005-03-18T09:52:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47846#p47846</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47846#p47846"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47846#p47846"><![CDATA[
Thanks a LOT! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> Really... works very well! Exactly what I imagined...<br>You really know your way into TCL scripting! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>If you come to Portugal say hello and I'll buy you a beer!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br>Greetz and Respect<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Fri Mar 18, 2005 9:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-18T00:44:56-04:00</updated>

		<published>2005-03-18T00:44:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47830#p47830</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47830#p47830"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47830#p47830"><![CDATA[
Turns out .txt files are sendt as part of the header...<br>I edited the code above, so go ahead and give it a try.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Fri Mar 18, 2005 12:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-03-17T23:43:25-04:00</updated>

		<published>2005-03-17T23:43:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47829#p47829</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47829#p47829"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47829#p47829"><![CDATA[
Test Results:<br><br>well, the code seems fine... I used it and no problem with the bot... I also made the .chanset command....<br><br>but when I type !news.... nothing shows up!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> <br>What could it be <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_question.gif" width="15" height="15" alt=":?:" title="Question"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Thu Mar 17, 2005 11:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-18T00:44:03-04:00</updated>

		<published>2005-03-17T22:47:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47821#p47821</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47821#p47821"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47821#p47821"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Set the chans you want to enable it in to +news# .chanset #channel +news# set this to the URL of the news fileset newsfile "http://someurl.com/file.txt" # want the answer to come out in notice (0) or privmsg (1)?set tellwho 0 setudef flag newsif ![info exists egghttp(version)] {  putlog "egghttp.tcl was NOT successfully loaded."  return}bind pub - !news getlistproc getlist {nick uhost hand chan text} { if ![channel get $chan news] return set sock [egghttp:geturl $::newsfile [list processlist $nick]]}proc processlist {nick sock} { set data [egghttp:headers $sock] egghttp:cleanup $sock set parse 0 foreach line [split $data \n] {  if $parse&amp;&amp;![string match ####* $line] {   if $::tellwho {    putserv "NOTICE $nick :$line"   } {    putserv "PRIVMSG $nick :$line"   }  }  if [string match -no Content-Type:* $line] {set parse 1} }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Thu Mar 17, 2005 10:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-03-17T19:08:33-04:00</updated>

		<published>2005-03-17T19:08:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47805#p47805</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47805#p47805"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47805#p47805"><![CDATA[
I've read all forum stuff that had the egghttp word... I see it's related (and I use the egghttp.tcl myself in my bot)... but I dunno really how to aplly it to this script... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_neutral.gif" width="15" height="15" alt=":|" title="Neutral"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Thu Mar 17, 2005 7:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-17T18:45:52-04:00</updated>

		<published>2005-03-17T18:45:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47803#p47803</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47803#p47803"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47803#p47803"><![CDATA[
Downloading files off the internet and then processing them is obviously a whole different ballgame than just reading a local file.<br><br>Have a look at the http package that comes with tcl, or possibly egghttp.tcl.<br><br>There should be plenty of examples on how to use both on this forum, just search for it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Thu Mar 17, 2005 6:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-03-15T20:38:18-04:00</updated>

		<published>2005-03-15T20:38:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47725#p47725</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47725#p47725"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47725#p47725"><![CDATA[
works like a charm!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br>but.....<br><br><br>set newsfile "<a href="http://someurl.com/file.txt" class="postlink">http://someurl.com/file.txt</a>"<br><br><br>this does not work... only works for root directory or any shell directory and not a site outside the shell...<br>how do I manage to put a txt from an outside site?<br>greetz<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Tue Mar 15, 2005 8:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-15T20:33:49-04:00</updated>

		<published>2005-03-15T20:33:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47724#p47724</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47724#p47724"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47724#p47724"><![CDATA[
Just replace that while loop in your code with this one<div class="codebox"><p>Code: </p><pre><code>while {![eof $news]} { set line [gets $news] if {![string match ####* $line]} {  if {$tellwho} {   putserv "PRIVMSG $nick :$line"   } else {   putserv "NOTICE $nick :$line"  } }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Tue Mar 15, 2005 8:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-03-15T20:28:24-04:00</updated>

		<published>2005-03-15T20:28:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47723#p47723</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47723#p47723"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47723#p47723"><![CDATA[
sorry for the n00bity, but where do I place that code?<br>greetz and thanks for the help!  <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=6079">Thunderdome</a> — Tue Mar 15, 2005 8:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-03-15T20:18:17-04:00</updated>

		<published>2005-03-15T20:18:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47722#p47722</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47722#p47722"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47722#p47722"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if ![string match ####* $line] {  # parse it}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Tue Mar 15, 2005 8:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-03-15T16:58:57-04:00</updated>

		<published>2005-03-15T16:58:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47716#p47716</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47716#p47716"/>
		<title type="html"><![CDATA[Read from a TXT file in alternative lines...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47716#p47716"><![CDATA[
Well... I have a txt file for a java applet news.... that goes like this:<br><br>##### bla bla bla code<br>text text text text<br>##### bla bla bla code<br>text text text text<br>##### bla bla bla code<br>text text text text<br>##### bla bla bla code<br>text text text text<br><br><br><br>I have a tcl script:<br><br><br><blockquote class="uncited"><div>#**********#<br># SETTINGS #<br>#**********#<br><br># set this to the full location of the news file<br>set newsfile "scripts/NewsMaker.txt"<br><br># want the answer to come out in notice (0) or privmsg (1)?<br>set tellwho 0<br><br># what channels do you want the script to work on?<br># write "*" to disable.<br>set newschan "#channel"<br><br>#*******#<br># BINDS #<br>#*******#<br><br>bind pub - !news holm-pub_news<br><br>#************************#<br># DO NOT EDIT UNDERNEATH #<br>#************************#<br><br>putlog "holm-news.tcl $ver by tw|ster (Stian Holm) loaded ..."<br><br>proc holm-pub_news {nick uhost handle channel text} {<br>global newsfile tellwho newschan<br>if {(([lsearch -exact [string tolower $newschan] [string tolower $channel]] != -1) || ($newschan == "*"))} {<br>if {![file exists "$newsfile"]} {<br>if {$tellwho} {<br>putserv "PRIVMSG $nick :.:error:. sorry, but i can't find the news file!"<br>} else {<br>putserv "NOTICE $nick :.:error:. sorry, but i can't find the news file!"<br>}<br>return 0<br>}<br>if {![file readable "$newsfile"]} {<br>if {$tellwho} {<br>putserv "PRIVMSG $nick :.:error:. sorry, but i'm not allowed to read that file!"<br>} else {<br>putserv "NOTICE $nick :.:error:. sorry, but i'm not allowed to read that file!"<br>}<br>return 0<br>}<br>set news [open "$newsfile" r]<br>while {![eof $news]} {<br>set line [gets $news]<br>if {$tellwho} {<br>putserv "PRIVMSG $nick :$line"<br>} else {<br>putserv "NOTICE $nick :$line"<br>}<br>}<br>close $news<br>}<br>}</div></blockquote><br>I modified the tcl script a bit for my own purposes... but I dont want it to read the full text! I just want it to read the lines with no ###<br>So, either the script ignores lines that start with #### or...<br>it reads like "line no, line yes, line no, line yes"<br><br>Can you guys help me out?<br>I know this may seem simple but I am complete newbie....<br>Greetz and thanks for the page and forum! Really helpfull![/quote]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Tue Mar 15, 2005 4:58 pm</p><hr />
]]></content>
	</entry>
	</feed>
