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

	<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>2001-12-12T20:15:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-12-12T20:15:00-04:00</updated>

		<published>2001-12-12T20:15:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2683#p2683</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2683#p2683"/>
		<title type="html"><![CDATA[2 things]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2683#p2683"><![CDATA[
Thanks, I will test it out tonight, and see how it does.<p>Statistics: Posted by Guest — Wed Dec 12, 2001 8:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2001-12-12T19:47:00-04:00</updated>

		<published>2001-12-12T19:47:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2681#p2681</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2681#p2681"/>
		<title type="html"><![CDATA[2 things]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2681#p2681"><![CDATA[
Since you said the text file is several megabytes, I did some non-standard line selection code so that it doesn't need to know the number of lines or scan in the whole file. If you have 100k lines, finding the 50k'th line takes a while in tcl heh. So the end result is that it may be very slightly biased for or against long lines in the file, depending on their distribution.<br><br>I didn't test it but it should be ok.<br><br>txtfile is the path of the file<br><br>min/max_interval is the delay between postings, in seconds<br><br>dest_chan is the channel in which it will be posted<br><div class="codebox"><p>Code: </p><pre><code>set txtfile {yourfile.txt}set min_interval 60set max_interval 120set dest_chan {#baaa}proc random_quote {} {  global txtfile dest_chan  set fp [open $txtfile r]  seek $fp 0 end  set len [tell $fp]  seek $fp [rand $len]  gets $fp partial  if {[gets $fp line] == -1} {    seek $fp 0    gets $fp line  }  putserv "PRIVMSG $dest_chan :$line"  return 0}proc random_timer {} {  global min_interval max_interval  set len [expr $max_interval - $min_interval]  set time [expr [rand $len] + $min_interval]  utimer $time random_timer  random_quote}if {![info exists random_quote_loaded]} {  set random_quote_loaded 1  putlog "*** Random Quote by stdragon loaded"  random_timer}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Dec 12, 2001 7:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-12-12T13:52:00-04:00</updated>

		<published>2001-12-12T13:52:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2664#p2664</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2664#p2664"/>
		<title type="html"><![CDATA[2 things]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2664#p2664"><![CDATA[
I was looking through all the scripts here, and on bseen, and all I can find is ctcp flood banning scripts, lately my channel has been getting flooded with ctcp replies, while it doesnt do any real damage, it is slightly annoying. Is there a tcl or easy way to convert a normal flood tcl to do ctcp reply instead of ctcp?  <br><br>Secondly, I have been looking for a tcl that will read a random line from a text file on a timer. Sort of like a cross between MC's random tcl, and a random quote script, but I already have a text file of a few meg, and dont want to sit, and edit it, to add the timer, and what not to my text file. <p>Statistics: Posted by Guest — Wed Dec 12, 2001 1:52 pm</p><hr />
]]></content>
	</entry>
	</feed>
