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

	<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-14T07:47:13-04:00</updated>

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

		<entry>
		<author><name><![CDATA[spock]]></name></author>
		<updated>2004-06-14T07:47:13-04:00</updated>

		<published>2004-06-14T07:47:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37322#p37322</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37322#p37322"/>
		<title type="html"><![CDATA[freebsd and ^M linebreaks while echoing text file to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37322#p37322"><![CDATA[
there have been a few threads in the past discussing the speed of regsub and other solutions. use "string map" wherever possible seems to be a popular conclusion (faster).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2369">spock</a> — Mon Jun 14, 2004 7:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-06-13T22:04:31-04:00</updated>

		<published>2004-06-13T22:04:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37317#p37317</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37317#p37317"/>
		<title type="html"><![CDATA[completed]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37317#p37317"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set cmd "!netstat"bind pub -|- $cmd log:pub #proc not made by me, can't remember who wrote it =)proc htmltotext {text} {  regsub -all -- {&lt;br&gt;} $text "\n" text  regsub -all -- {&lt;/b&gt;|&lt;/font&gt;} $text { } text  regsub -all -- {&lt;[^&gt;]*&gt;} $text {} text  regsub -all -- { |[&lt;*&gt;]} $text { } text  return $text}proc log:pub {nick handle host chan text } {  set foo [open "/home/rvwinkle/eggdrop1.6.16/scripts/ehco.txt" "r"]  foreach line [split [read $foo] \n] {    puthelp "PRIVMSG $chan :[htmltotext $line]"  }  close $foo}</code></pre></div>Just in case anyone wanted info on how it was done , the above example works fine to echo the contents of a text file in our irc channel and strip any html code from that file. Seems kind of slow tho, any pointers on making it faster ?<p>Statistics: Posted by Guest — Sun Jun 13, 2004 10:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-06-12T10:41:44-04:00</updated>

		<published>2004-06-12T10:41:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37249#p37249</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37249#p37249"/>
		<title type="html"><![CDATA[getting farther]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37249#p37249"><![CDATA[
Thanks for the input yesterday <br><br>I ended up using a dupe limiter in main eggdrop config as i could never find info on the correct string to use for the filter but it works now and I am interested in implementing the html filter <br><br>this is the code i have so far<br><div class="codebox"><p>Code: </p><pre><code>set cmd "!netstat"bind pub -|- $cmd log:pubproc log:pub {nick handle host chan text } {  set foo [open "/www/message.txt" "r"]  foreach line [split [read $foo] \n] {    puthelp "PRIVMSG $chan :$line"  }  close $foo}</code></pre></div>Can anyone provide some pointers on implenting this bit of code on the output?<br><div class="codebox"><p>Code: </p><pre><code>#proc not made by me, can't remember who wrote it =)proc htmltotext {text} {  regsub -all -- {&lt;br&gt;} $text "\n" text  regsub -all -- {&lt;/b&gt;|&lt;/font&gt;} $text { } text  regsub -all -- {&lt;[^&gt;]*&gt;} $text {} text  regsub -all -- { |[&lt;*&gt;]} $text { } text  return $text}</code></pre></div><p>Statistics: Posted by Guest — Sat Jun 12, 2004 10:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-06-11T13:17:13-04:00</updated>

		<published>2004-06-11T13:17:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37217#p37217</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37217#p37217"/>
		<title type="html"><![CDATA[freebsd and ^M linebreaks while echoing text file to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37217#p37217"><![CDATA[
Yeah it's not really "^M" it's "\r" or something.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Fri Jun 11, 2004 1:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-06-11T12:40:32-04:00</updated>

		<published>2004-06-11T12:40:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37216#p37216</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37216#p37216"/>
		<title type="html"><![CDATA[stuck on this]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37216#p37216"><![CDATA[
this is what i have manged so far...<br><div class="codebox"><p>Code: </p><pre><code>set bfile "/www/message.txt"set cmd "!netstat"set bwhere 0bind pub -|- $cmd dumpfileproc dumpfile {nick handle host chan text } {global bfile bwhereset foo [open $bfile r]while { ! [eof $foo] } {set line [gets $foo]if {[string equal ^M $line]} { continue }if {!$bwhere} {puthelp "PRIVMSG $chan :$line"}}}</code></pre></div>it is still displaying the line breaks as empty lines<br>am i doing it wrong ?<br>Sorry if this is a newbie mistake<p>Statistics: Posted by Guest — Fri Jun 11, 2004 12:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spock]]></name></author>
		<updated>2004-06-11T12:23:19-04:00</updated>

		<published>2004-06-11T12:23:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37215#p37215</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37215#p37215"/>
		<title type="html"><![CDATA[freebsd and ^M linebreaks while echoing text file to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37215#p37215"><![CDATA[
dont forget to close $bfile when you are done with it<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2369">spock</a> — Fri Jun 11, 2004 12:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2004-06-11T10:40:14-04:00</updated>

		<published>2004-06-11T10:40:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37213#p37213</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37213#p37213"/>
		<title type="html"><![CDATA[freebsd and ^M linebreaks while echoing text file to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37213#p37213"><![CDATA[
just add this right after your gets to make it ignore the ^M lines<div class="codebox"><p>Code: </p><pre><code>if {[string equal ^M $line]} { continue }</code></pre></div>Use this to strip all the html codes<div class="codebox"><p>Code: </p><pre><code>#proc not made by me, can't remember who wrote it =)proc htmltotext {text} {  regsub -all -- {&lt;br&gt;} $text "\n" text  regsub -all -- {&lt;/b&gt;|&lt;/font&gt;} $text { } text   regsub -all -- {&lt;[^&gt;]*&gt;} $text {} text   regsub -all -- { |[&lt;*&gt;]} $text { } text  return $text}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Fri Jun 11, 2004 10:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-06-11T10:05:21-04:00</updated>

		<published>2004-06-11T10:05:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37212#p37212</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37212#p37212"/>
		<title type="html"><![CDATA[freebsd and ^M linebreaks while echoing text file to channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37212#p37212"><![CDATA[
Hello I have found the follwoing simple code to echo the contents of a text file  in my channel when triggered. <br><div class="codebox"><p>Code: </p><pre><code>set bfile "/www/message.txt"set cmd "!netstat"set bwhere 0bind pub -|- $cmd dumpfileproc dumpfile {nick handle host chan text } {global bfile bwhereset foo [open $bfile r]while { ! [eof $foo] } {set line [gets $foo]if {!$bwhere} {puthelp "PRIVMSG $chan :$line"}}}</code></pre></div>The message.txt file is edited by a php utility that I do not have access to change. The php utility adds a ^M to the bottom of the file everytime someone submits a new entry.<br>On linux the tcl script I am using ignores the ^M characters and the bot only says the relevant parts but on freebsd i get an empty line for every ^M character. I am currently reading up on regexpr but it still seems daunting to me. Is there a simple way for me to tell the bot to ignore the windows linebreaks?<br><br>Thank you for any help you can provide in the regard.<br><br>p.s. here is a snippet from the text file so you can see what i mean if needed....Stripping the html code out to would be super awesome but is not required.<br><blockquote class="uncited"><div>Issues with hi-rez - mt=987654.^M<br>&lt;b&gt;&lt;font color=green size=4&gt;Net&lt;/font&gt;&lt;font color=blue size=4&gt;cool&lt;/fon<br>t&gt; - It's netcool son, netcool. It ain't that hard.^M<br>^M<br> ^M<br> ^M<br> ^M<br> ^M<br> ^M<br> ^M</div></blockquote><p>Statistics: Posted by Guest — Fri Jun 11, 2004 10:05 am</p><hr />
]]></content>
	</entry>
	</feed>
