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

	<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-11-28T19:35:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-11-28T19:35:00-04:00</updated>

		<published>2001-11-28T19:35:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2193#p2193</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2193#p2193"/>
		<title type="html"><![CDATA[random line help needed]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2193#p2193"><![CDATA[
Thanks. That fixed it!<p>Statistics: Posted by Guest — Wed Nov 28, 2001 7:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-11-28T11:49:00-04:00</updated>

		<published>2001-11-28T11:49:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2175#p2175</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2175#p2175"/>
		<title type="html"><![CDATA[random line help needed]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2175#p2175"><![CDATA[
For a start, there is no need to loop through a for loop, just to setup a time bind. The time bind matches by a mask, so as long as a * is there, it will run once a min.<br><br>Again, there is no need fore the for loop inside the proc, this will only confuse you.<br><br>the following should work<div class="codebox"><p>Code: </p><pre><code>bind time - "*" reandlineproc randline {min hour day month year} {  set fp [open "C:/Inetpub/wwwroot/botads.txt" e]  set temp [split [read $fp] n]  close $fp  puthelp "PRIVMSG #channel :[lindex $temp [rand [llength $temp]]]"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Nov 28, 2001 11:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-11-28T02:38:00-04:00</updated>

		<published>2001-11-28T02:38:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=2156#p2156</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=2156#p2156"/>
		<title type="html"><![CDATA[random line help needed]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=2156#p2156"><![CDATA[
I am trying to get a random line from a txt file to play every hour, but am stumped on what to change in the following code to make that happen. Any help would be appreciated.<br><br># randline.tcl - read a random line to an IRC dest. every minute<br>for {set i 0} {$i &lt; 60} {incr i} {bind time - "$i * * * *" readline}<br>proc readline {minutes hour day month year} {<br>  set fp [open "c:/Inetpub/wwwroot/botads.txt" r]<br>  for {set i 0} {![eof $fp]} {incr i} {set data($i) "[gets $fp]"}<br>  close $fp<br><br>  putserv "PRIVMSG #channel :$data([rand $i])"<br>}<br><p>Statistics: Posted by Guest — Wed Nov 28, 2001 2:38 am</p><hr />
]]></content>
	</entry>
	</feed>
