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

	<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>2020-06-28T08:48:44-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2020-06-28T08:48:44-04:00</updated>

		<published>2020-06-28T08:48:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108654#p108654</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108654#p108654"/>
		<title type="html"><![CDATA[Topic TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108654#p108654"><![CDATA[
You would need to call your new getRandomTopic process when needed...<br><br>Try replace [get_TopicRandomItem] with [getRandomTopic]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sun Jun 28, 2020 8:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[KhashayaR]]></name></author>
		<updated>2020-06-28T03:52:08-04:00</updated>

		<published>2020-06-28T03:52:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108653#p108653</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108653#p108653"/>
		<title type="html"><![CDATA[Topic TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108653#p108653"><![CDATA[
I'm not sure what is wrong in here <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> but it's not working<br><br>my aim is  TCL read the topic content from a separate text file located on script/ <div class="codebox"><p>Code: </p><pre><code>bind time - "00 * * * *" Displaytimenowbind time - "05 * * * *" Displaytimenowset TopicFile "scripts/TopicFile.txt"proc getRandomTopic {} {  global TopicFile  if {![file exists $TopicFile]} { return "$TopicFile does not exist" }  set openfile [open $TopicFile]  set topics [split [read -nonewline $openfile] \n]  close $openfile  set output [lindex $topics [rand [llength $topics]]]  return $output}proc Displaytimenow {n h handle ch te} { global botnick showtimechans foreach channel [channels] { set topichan [get_TopicRandomItem] regsub {\$chan} $topichan $channel topichan putquick "TOPIC $channel :$topichan" }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9165">KhashayaR</a> — Sun Jun 28, 2020 3:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[KhashayaR]]></name></author>
		<updated>2020-06-08T08:37:42-04:00</updated>

		<published>2020-06-08T08:37:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108512#p108512</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108512#p108512"/>
		<title type="html"><![CDATA[Topic TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108512#p108512"><![CDATA[
Thanks   SpiKe^^<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9165">KhashayaR</a> — Mon Jun 08, 2020 8:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2020-06-05T14:17:00-04:00</updated>

		<published>2020-06-05T14:17:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108504#p108504</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108504#p108504"/>
		<title type="html"><![CDATA[proc getRandomTopic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108504#p108504"><![CDATA[
This process should return a random line from a file.<div class="codebox"><p>Code: </p><pre><code>set TopicFile "scripts/TopicFile.txt"proc getRandomTopic {} {  global TopicFile  if {![file exists $TopicFile]} { return "$TopicFile does not exist" }  set openfile [open $TopicFile]  set topics [split [read -nonewline $openfile] \n]  close $openfile  set output [lindex $topics [rand [llength $topics]]]  return $output}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Jun 05, 2020 2:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[KhashayaR]]></name></author>
		<updated>2020-06-05T03:13:44-04:00</updated>

		<published>2020-06-05T03:13:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108499#p108499</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108499#p108499"/>
		<title type="html"><![CDATA[Topic TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108499#p108499"><![CDATA[
hello I wonder if someone can help me with this TCL here is what I would like to happen <br><br>-currently, the TCL read the topic content from inside the TCL as you can see,  is there any way TCL read the topic content from a separate text file?<br><br>please see below <div class="codebox"><p>Code: </p><pre><code>######################################################################## Set the Topic format here. See below for a list of format settings. ## ------------------------------------------------------------------- ## $chan - Name of channel                                             ######################################################################## set TopicToUse {{ Random quotes can be most effecatious }}######################################################################################################################################################################################### STOP EDITING ##########################################################################################################################################################################################bind time - "00 * * * *" Displaytimenowbind time - "360 * * * *" Displaytimenow## Proc to Randomly Select an Info Item!proc get_TopicRandomItem { } { global TopicToUse set output [lindex $TopicToUse [rand [llength $TopicToUse]]] return $output}proc Displaytimenow {n h handle ch te} {  global botnick showtimechans foreach channel [channels] { set topichan [get_TopicRandomItem] regsub {\$chan} $topichan $channel topichan putquick "TOPIC $channel :$topichan" }}## -----------------------------------------------------------------------putlog "Random Topic loaded Successfuly..."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9165">KhashayaR</a> — Fri Jun 05, 2020 3:13 am</p><hr />
]]></content>
	</entry>
	</feed>
