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

	<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>2010-08-06T11:14:24-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2010-08-06T11:14:24-04:00</updated>

		<published>2010-08-06T11:14:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93787#p93787</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93787#p93787"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93787#p93787"><![CDATA[
Quakenet, #WillyW<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Fri Aug 06, 2010 11:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-08-06T11:13:19-04:00</updated>

		<published>2010-08-06T11:13:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93786#p93786</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93786#p93786"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93786#p93786"><![CDATA[
<blockquote class="uncited"><div>It was already set to +announcer so afterwards I wrote !enable - thought it couldn't hurt.<br>Even without the channel, it wrote an error as you can see..<br><br>The message file doesn't exist</div></blockquote>So far, I haven't been able to duplicate this.<br>I went to a channel in my test bot,   in the partyline   .chanset #channel +announcer<br>and let it run.<br>When it announced in another running channel,  at the same time, it created the message file for the newly added channel.<br><br>Are you available, on IRC somewhere right now?<br>Perhaps we could cover more ground, faster.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Fri Aug 06, 2010 11:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2010-08-06T11:02:54-04:00</updated>

		<published>2010-08-06T11:02:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93785#p93785</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93785#p93785"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93785#p93785"><![CDATA[
It was already set to +announcer so afterwards I wrote !enable - thought it couldn't hurt.<br>Even without the channel, it wrote an error as you can see..<br><br>The message file doesn't exist<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Fri Aug 06, 2010 11:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-08-06T10:59:20-04:00</updated>

		<published>2010-08-06T10:59:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93784#p93784</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93784#p93784"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93784#p93784"><![CDATA[
<blockquote class="uncited"><div>[17:53:20] -&gt; *EPL* !timeron<br>[17:53:20] &lt;EPL&gt; [14:53] Tcl error [msg_timer_on]: can't set "line_counter(#EPL)": variable isn't array<br><br>[17:53:44] -&gt; *EPL* !timeron #EPL<br>[17:53:45] &lt;EPL&gt; [14:53] Tcl error [msg_timer_on]: can't set "line_counter(#EPL)": variable isn't array</div></blockquote>How did you enable channel #EPL ?     via dcc using  .chanset #epl +announcer?<br>or via  !enable?<br><br>Also, that command does not need a #channel.<blockquote class="uncited"><div>#  (  !timeron , !timeroff,  and   !settimer    via /msg do not require a #channel   ) </div></blockquote>Just curious - at the time you got the error, did the message file for #EPL exist?<br><br>I will try to duplicate that error, in the meantime.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Fri Aug 06, 2010 10:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2010-08-06T10:57:48-04:00</updated>

		<published>2010-08-06T10:57:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93783#p93783</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93783#p93783"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93783#p93783"><![CDATA[
[17:56:43] -&gt; *Football* !enable #football<br>[17:56:43] &lt;Football&gt; [14:56] Tcl error [msg_enable]: couldn't open "scripts/messages/#football": no such file or directory<br>[17:56:44] -Football- Timed Announcer enabled on #football<br>[17:56:49] -&gt; *Football* !settimer 180<br>[17:56:50] -Football- Timer will be set to 180 minutes<br>[17:56:52] -&gt; *Football* !timeron<br>[17:56:53] &lt;Football&gt; [14:56] Tcl error [msg_timer_on]: can't set "line_counter(#football)": variable isn't array<br>[17:56:56] -&gt; *Football* !timeron #football<br>[17:56:56] &lt;Football&gt; [14:56] Tcl error [msg_timer_on]: can't set "line_counter(#football)": variable isn't array<br>[17:56:58] -&gt; *Football* !addmsg #football hey<br>[17:56:58] &lt;Football&gt; [14:56] Tcl error<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Fri Aug 06, 2010 10:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2010-08-06T10:54:07-04:00</updated>

		<published>2010-08-06T10:54:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93782#p93782</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93782#p93782"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93782#p93782"><![CDATA[
[17:53:20] -&gt; *EPL* !timeron<br>[17:53:20] &lt;EPL&gt; [14:53] Tcl error [msg_timer_on]: can't set "line_counter(#EPL)": variable isn't array<br><br>[17:53:44] -&gt; *EPL* !timeron #EPL<br>[17:53:45] &lt;EPL&gt; [14:53] Tcl error [msg_timer_on]: can't set "line_counter(#EPL)": variable isn't array<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Fri Aug 06, 2010 10:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-08-06T10:44:08-04:00</updated>

		<published>2010-08-06T10:44:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93781#p93781</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93781#p93781"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93781#p93781"><![CDATA[
<blockquote class="uncited"><div>...<br>[11:29:34] &lt;EPL&gt; [08:29] Tcl error [listmsg]: couldn't open "scripts/messages/#EPL": no such file or directory<br><br>Shouldn't it create the file when you try one of the commands?<br><br>[11:29:34] &lt;EPL&gt; [08:29] Tcl error [listmsg]: couldn't open "scripts/messages/#EPL": no such file or directory<br><br>...</div></blockquote>Do us a favor, please:<br><br>Try to duplicate the above, by adding new channels to the bot, and using !listmsg.<br>What I want to know is:   When you did the above quoted,  did you do it with !listmsg as a public command?   ( I think you did, but want to confirm it)<br>Then, be sure to try it both ways.   As public command, and :<br>/msg botnick !listmsg #channel<br>and let me know if it behaves differently, with the /msg method.<br><br>See...  I had a quick look, and it appears I did put in a check, in the /msg method of the !listmsg command,  and the bot should simply tell you that the file doesn't exist, and not error.  This check does not actually create the file,  just looks for it, and tells you if it is not there.<br>I guess I realized it should be there, as I was adding the procedure for the /msg method...<br>... and apparently I forgot to go back and put it in the public command method.   <br><br>After you check it both ways, and are sure of the results -  be sure to remember it and remind me - if we ever go over the script again, we can add it in the pub !listmsg command too.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Fri Aug 06, 2010 10:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-08-06T10:37:03-04:00</updated>

		<published>2010-08-06T10:37:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93780#p93780</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93780#p93780"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93780#p93780"><![CDATA[
<blockquote class="uncited"><div>Hey willyw, thanks for the hard work and reply again!<br><br><br>[11:31:01] &lt;EPL&gt; [08:31] Tcl error [proc:laina]: invalid command name "PRIVMSG #EPL-Staff :&lt;Xabriel!<a href="mailto:Boca@MeSCh.users.quakenet.org">Boca@MeSCh.users.quakenet.org</a>&gt;: </div></blockquote>It appears that something is calling "proc:laina", whatever that is.  <br>It is not a procedure in my script. <br>If this is something that just started, then it is likely you've just installed another script, and it is in that script.  If not, then you could comment out *all* scripts, and load them back one at a time, until you figure out which script it is in.<br><blockquote class="uncited"><div><br><br>!addmsg #EPL NEW #EPL Addon Uploaded! Date Release: July 20th. <a href="http://tinyurl.com/2wzoukk" class="postlink">http://tinyurl.com/2wzoukk</a>"<br><br>Not sure what the error is about...</div></blockquote>Neither am I.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><blockquote class="uncited"><div><br>[11:29:34] &lt;EPL&gt; [08:29] Tcl error [listmsg]: couldn't open "scripts/messages/#EPL": no such file or directory<br><br>Shouldn't it create the file when you try one of the commands?<br><br>[11:29:34] &lt;EPL&gt; [08:29] Tcl error [listmsg]: couldn't open "scripts/messages/#EPL": no such file or directory<br></div></blockquote>I could have put in a check, in every command - yes.<br>I didn't..  I suppose it seems a bit redundant.<br><br>It does check for the existence of the file, and create it if not found - at two points.<br>One: if you use the !enable command to enable a channel.<br>Two: every time the run_announce procedure runs ... in other words, every time the timer triggers.<br><br>Thinking...   I wonder just what would be the best, most efficient<br>times to check for the existence of them.<br><blockquote class="uncited"><div>Why is it #EPL and not #EPL.txt ?</div></blockquote>Because that is what I named it.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><br>Seriously -  would you like the files to be named with a    .txt  extentsion?<br>It should be easy to  do.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Fri Aug 06, 2010 10:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2010-08-06T04:34:44-04:00</updated>

		<published>2010-08-06T04:34:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93777#p93777</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93777#p93777"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93777#p93777"><![CDATA[
Hey willyw, thanks for the hard work and reply again!<br><br><br>[11:31:01] &lt;EPL&gt; [08:31] Tcl error [proc:laina]: invalid command name "PRIVMSG #EPL-Staff :&lt;Xabriel!<a href="mailto:Boca@MeSCh.users.quakenet.org">Boca@MeSCh.users.quakenet.org</a>&gt;: !addmsg #EPL NEW #EPL Addon Uploaded! Date Release: July 20th. <a href="http://tinyurl.com/2wzoukk" class="postlink">http://tinyurl.com/2wzoukk</a>"<br><br>Not sure what the error is about...<br><br><br>[11:29:34] &lt;EPL&gt; [08:29] Tcl error [listmsg]: couldn't open "scripts/messages/#EPL": no such file or directory<br><br>Shouldn't it create the file when you try one of the commands?<br><br>[11:29:34] &lt;EPL&gt; [08:29] Tcl error [listmsg]: couldn't open "scripts/messages/#EPL": no such file or directory<br><br>Why is it #EPL and not #EPL.txt ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Fri Aug 06, 2010 4:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2010-08-06T04:33:41-04:00</updated>

		<published>2010-08-06T04:33:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93776#p93776</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93776#p93776"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93776#p93776"><![CDATA[
[11:31:01] &lt;EPL&gt; [08:31] Tcl error [proc:laina]: invalid command name "PRIVMSG #EPL-Staff :&lt;Xabriel!<a href="mailto:Boca@MeSCh.users.quakenet.org">Boca@MeSCh.users.quakenet.org</a>&gt;: !addmsg #EPL NEW #EPL Addon Uploaded! Date Release: July 20th. <a href="http://tinyurl.com/2wzoukk" class="postlink">http://tinyurl.com/2wzoukk</a>"<br><br>Not sure what the error is about...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Fri Aug 06, 2010 4:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-08-05T14:41:35-04:00</updated>

		<published>2010-08-05T14:41:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93775#p93775</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93775#p93775"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93775#p93775"><![CDATA[
Here we go...   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">     ... Give this a try.<br><br>--Added binds and proc so you can use /msg.  <br><br>--Is now multi-chan, with seperate message files on a per-channel basis. <br><br>I've run low on time today, and rather than hold onto it for further testing,<br>I'm hoping that you will thoroughly test it, and report back.<br>I have played with it,  on a test bot, in two channels.<br>But, there are so many combinations  of possibilities, no doubt that I've overlooked something.<br><br>Be sure to note the difference in the Config below: Now you set just the directory that holds the message files, and NOT the filename too.<br><br><div class="codebox"><p>Code: </p><pre><code># August 4, 2010# fixed : if {[botonchan $chan]} {putserv "privmsg $chan : [join [lindex [split $data \n] $line_counter]] "}#         ^^^^^^^^^^^^^^^^^^^^^ was not there       and it is possible for bot to NOT be in a channel, that has +announcer set## moved the section that increments the line counter in proc run_announce, as it looked like it was incrementing for each chan# not just for each run of run_announce# changed the determination of number of lines in file, in case NO channels have +announcer set## added more binds and proc, so that commands may be sent via  /msg# Is now multi-chan, with seperate message files on a per-channel basis           #################### August 3, 2010# http://forum.egghelp.org/viewtopic.php?p=93728#93728#########################################################The public commands would be:#!enable#!disable#!settimer#!addmsg#!delmsg#!listmsg#!timeron#!timeroff#!status#!setline#!enable - will enable the script in the current channel#!disable - will disable the script in the current channel#!status - will notify you whether the script is enabled or disabled#!addmsg &lt;message-here&gt; and the bot will add it to his list#!listmsg &lt;number&gt; - will list one message, from line #&lt;number&gt;#!listmsg          - will list all the messages that were added to the bot#!delmsg &lt;message-number&gt; - will erase that specific message#!settimer &lt;number of minutes&gt; - Every X minutes the bot will display the messages by order; #1 and then X minutes later #2 and so on#!settimer              will display the current setting.#!timeroff Stops the timer for message display   (timer is ON, when bot starts )#!timeron  Starts the timer for message display (without having to restart the bot)#!setline &lt;number&gt;  Manually set the line number of the next displayed line#!setline           will display current setting###     Same commands work, via /msg, but many must include #channel as first word of msg## Example:    /msg botnick !enable #channel##    (  !timeron , !timeroff,  and   !settimer    via /msg do not require a #channel   ) ########################################## Config# Set the path and directory name for the directory that will hold message files.    Be sure to include the trailing forward slash.set message_file_dir "scripts/"# Set the default starting timer minutes. # This is the time that will be used after a restart, until a !settimer command is used to change it.set timer_minutes 2##### End Config########### script begins herebind pub - "!addmsg" addmsgbind pub - "!listmsg" listmsgbind pub - "!delmsg" delmsgbind pub - "!settimer" settimerbind pub - "!enable" enablebind pub - "!disable" disablebind pub - "!status" statusbind pub - "!timeroff" timer_offbind pub - "!timeron" timer_onbind pub - "!setline" setlinebind msg o "!addmsg" msg_addmsgbind msg o "!listmsg" msg_listmsgbind msg o "!delmsg" msg_delmsgbind msg o "!settimer" msg_settimer         bind msg o "!enable" msg_enablebind msg o "!disable" msg_disablebind msg o "!status" msg_statusbind msg o "!timeroff" msg_timer_offbind msg o "!timeron" msg_timer_onbind msg o "!setline" msg_setlinesetudef flag announcer## Check to see if script is loaded already, and if not, then start timer.## The idea is to NOT start additional timers, after a rehash if {![info exists timer_announcer_loaded]} {set timer_announcer_loaded 1    timer $timer_minutes run_announce   } ## Sends one message to channel, every XX minutes, incrementing through stored messages.proc run_announce {} {global message_file_dir timer_minutes line_counter foreach chan [channels] {   if {([lsearch -exact [channel info $chan] {+announcer}] != -1)} {if {![info exists line_counter($chan)]} {set line_counter($chan) 0}if {$line_counter($chan) &lt; 0} {set line_counter($chan) 0     }if {![file exist $message_file_dir${chan}]} {    close [open $message_file_dir${chan} w]         }set phile [open $message_file_dir${chan} "r"]set data [read -nonewline $phile] close $phile#Check to see if the line number we are looking for, is greater than the actual number of lines in the message file#and if so, instead have it go to the last lineif {[llength [split $data \n]]&lt;=$line_counter($chan)} {set line_counter($chan) [expr [llength [split $data \n]] - 1]}      #Display the lineif {"[lindex [split $data \n] $line_counter($chan)]"!=""} {if {[botonchan $chan]} {putserv "privmsg $chan : [join [lindex [split $data \n] $line_counter($chan)]] "}      incr line_counter($chan)if {[llength [split $data \n]] &lt;= $line_counter($chan)} {set line_counter($chan) 0  }   } }    }   # re-starts the timer, to run this proc againtimer $timer_minutes run_announce}## Allows line counter to be manually setproc setline {nick uhost handle chan text} {global line_counterif {[string is integer -strict [join [lindex [split $text] 0]]]} {set line_counter($chan) [expr [lindex [split $text] 0] -1]putserv "notice $nick :Next line displayed in $chan will be line [expr $line_counter($chan) +1]"} else {putserv "notice $nick :Next line displayed in $chan will be line [expr $line_counter($chan) +1]"  }}#Via MSG - setlineproc msg_setline {nick uhost handle text} {global botnick line_counterif {"$text"==""} {putserv "notice $nick :Syntax: /msg $botnick !setline #&lt;channel&gt; \[number\]"putserv "notice $nick :\[number\] is optional.  Without it, !setline will report only"return 0  }set chan [lindex [split $text] 0]  if {[validchan $chan]} {if {[string is integer -strict [join [lindex [split $text] 1]]]} {set line_counter($chan) [expr [lindex [split $text] 1] -1]putserv "notice $nick :Next line displayed in $chan will be line [expr $line_counter($chan) +1]"} else {putserv "notice $nick :Next line displayed in $chan will be line [expr $line_counter($chan) +1]"  }  } else {putserv "notice $nick :$chan is not a valid channel on $botnick" }}##Allows timer delay to be changed via a pub commandproc settimer {nick uhost handle chan text} {global timer_minutesif {([lsearch -exact [channel info $chan] {+announcer}] != -1)} {if {"[lindex [split $text] 0]"==""} {putserv "notice $nick :Timer is set to $timer_minutes minutes"} elseif {"[lindex [split $text] 0]"&lt;="0"} {putserv "notice $nick :No change. Timer must be set to a positive integer" } else {set timer_minutes "[lindex [split $text] 0]"putserv "notice $nick :Timer will be set to $timer_minutes minutes"}  }}# Via MSG - change timer delayproc msg_settimer {nick uhost handle text} {global timer_minutesif {"[lindex [split $text] 0]"==""} {putserv "notice $nick :Timer is set to $timer_minutes minutes"} elseif {"[lindex [split $text] 0]"&lt;="0"} {putserv "notice $nick :No change. Timer must be set to a positive integer" } else {set timer_minutes "[lindex [split $text] 0]"putserv "notice $nick :Timer will be set to $timer_minutes minutes"}}##Allows timer to be turned off via a pub commandproc timer_off {nick uhost handle chan text} {if {([lsearch -exact [channel info $chan] {+announcer}] != -1)} {foreach thetimer [timers] { if {[string match -nocase "run_announce*" [lindex $thetimer 1]]} {  # got a match  killtimer [lindex $thetimer 2]  putserv "notice $nick :Timed Announcer is off"  # killed the timerID which is the 3rd element of $thetimer.  break  # stopped since no need for further checks.      }     }# credit: http://forum.egghelp.org/viewtopic.php?p=53896#53896  }}# Via MSG - timer offproc msg_timer_off {nick uhost handle text} {foreach thetimer [timers] { if {[string match -nocase "run_announce*" [lindex $thetimer 1]]} {  # got a match  killtimer [lindex $thetimer 2]  putserv "notice $nick :Timed Announcer is off"  # killed the timerID which is the 3rd element of $thetimer.  break  # stopped since no need for further checks.      }     }  }## Allows timer to be turned on via a pub commandproc timer_on {nick uhost handle chan text} {if {([lsearch -exact [channel info $chan] {+announcer}] != -1)} {if {"[timerexists run_announce]"==""} {run_announceputserv "notice $nick :Timed Announcer is on"}   }}#Via MSG - timeronproc msg_timer_on {nick uhost handle text} {if {"[timerexists run_announce]"==""} {run_announceputserv "notice $nick :Timed Announcer is on"}  }## Used by other procedure, to find out if a timer already existsproc timerexists {command} {  foreach i [timers] {    if {![string compare $command [lindex $i 1]]} then {      return [lindex $i 2]}  }  return#credit:  from alltools.tcl}## Allows messages to be added via a pub commandproc addmsg {nick uhost handle chan text} {global message_file_dirif {([lsearch -exact [channel info $chan] {+announcer}] != -1)} {if {"$text"==""} {putserv "notice $nick :Syntax: !addmsg &lt;message here..... &gt;"return 0  }set phile [open $message_file_dir${chan} "r"]set first_line [gets $phile]close $phileif {"$first_line"==""} {set phile [open $message_file_dir${chan} "w"] puts $phile "[lrange [split $text] 0 end]"     close $phile} else {set phile [open $message_file_dir${chan} "a"] puts $phile "[lrange [split $text] 0 end]"close $phile   }putserv "notice $nick :Added:   \"[join [lrange [split $text] 0 end]]\" "  }}# Via MSG - addmsgproc msg_addmsg {nick uhost handle text} {global botnick message_file_dirset chan [lindex [split $text] 0]if {"$text"==""} {putserv "notice $nick :Syntax: /msg $botnick !addmsg #&lt;channel&gt; &lt;message here..... &gt;"return 0  }if {[validchan $chan]} {set phile [open $message_file_dir${chan} "r"]set first_line [gets $phile]close $phileif {"$first_line"==""} {set phile [open $message_file_dir${chan} "w"] puts $phile "[lrange [split $text] 1 end]"     close $phile} else {set phile [open $message_file_dir${chan} "a"] puts $phile "[lrange [split $text] 1 end]"close $phile   }putserv "notice $nick :Added:   \"[join [lrange [split $text] 1 end]]\" " } else {putserv "notice $nick :$chan is not a valid channel on $botnick" } }## Will display all messages, in response to a pub commandproc listmsg {nick uhost handle chan text} {global message_file_dir line_counterif {([lsearch -exact [channel info $chan] {+announcer}] != -1)} {#Display one message via notice, only if a number is given with !listmsg - if no number given, then list all messagesif {[string is integer -strict [join [lindex [split $text] 0]]]} {set phile [open $message_file_dir${chan} "r"]set data [read -nonewline $phile] close $phileif {[llength [split $data \n]]&gt;=[lindex [split $text] 0]} {putserv "notice $nick :[join [lindex [split $data \n] [expr [lindex [split $text] 0]-1]]]"} else {putserv "notice $nick :No such line"}return 0  }set phile [open $message_file_dir${chan} "r"]set first_line [gets $phile]close $phileif {"$first_line"==""} {putserv "notice $nick : I got nothing"return 0}set lnum 0set phile [open $message_file_dir${chan} "r"]while {[gets $phile line] &gt;= 0} {putserv "notice $nick :[incr lnum]: [join $line]"}close $phile#credit: Luminous  }}# Via MSG - !listmsgproc msg_listmsg {nick uhost handle text} {global botnick message_file_dir line_counterset chan [lindex [split $text] 0]if {"$text"==""} {putserv "notice $nick :Syntax: /msg $botnick !listmsg #&lt;channel&gt; \[#\]"putserv "notice $nick :The number is optional. Without it, all messages are listed.  Include it, and only that message is displayed"return 0    }if {[validchan $chan]} {if {![file exists $message_file_dir${chan}]} {putserv "notice $nick :No message file exists yet, for $chan"putserv "notice $nick :The first time you use !enable to enable $chan, an empty message file will be created for $chan"return 0       }#Display one message via notice, only if a number is given with !listmsg - if no number given, then list all messagesif {[string is integer -strict [join [lindex [split $text] 1]]]} {set phile [open $message_file_dir${chan} "r"]set data [read -nonewline $phile] close $phileif {[llength [split $data \n]]&gt;=[lindex [split $text] 1]} {putserv "notice $nick :[join [lindex [split $data \n] [expr [lindex [split $text] 1]-1]]]"} else {putserv "notice $nick :No such line"}return 0  }set phile [open $message_file_dir${chan} "r"]set first_line [gets $phile]close $phileif {"$first_line"==""} {putserv "notice $nick : I got nothing"return 0}set lnum 0set phile [open $message_file_dir${chan} "r"]while {[gets $phile line] &gt;= 0} {putserv "notice $nick :[incr lnum]: [join $line]"}close $phile#credit: Luminous  } else {putserv "notice $nick :[lindex [split $text] 0] is not a valid channel on $botnick"   }}## Allows a message to be deleted (by message number, see !listmsg) via a pub commandproc delmsg {nick uhost handle chan text} {global message_file_dirif {([lsearch -exact [channel info $chan] {+announcer}] != -1)} {if {"$text"==""} {putserv "notice $nick :Syntax: !delmsg &lt;number&gt;"putserv "notice $nick :Use !listmsg     to get line numbers"return 0}set del_line_num [expr [lindex [split $text] 0] - 1 ]if {$del_line_num &lt; 0} {putserv "notice $nick :No can do.  Must be 1 or greater."return 0} set phile [open $message_file_dir${chan} r]set data [read -nonewline $phile] close $phileset lines [split $data "\n"]      if {[llength $lines] &lt;= $del_line_num} {putserv "notice $nick :No such line number"return 0   }putserv "notice $nick :Deleting:  [join [lindex $lines $del_line_num]]"putserv "notice $nick :      (use  !listmsg   again now, as you may have changed the line numbers!)"set lines [lreplace $lines $del_line_num $del_line_num]set phile [open $message_file_dir${chan} "w"]puts $phile [join $lines "\n"]close $phile  }}# Via MSG - delmsgproc msg_delmsg {nick uhost handle text} {global botnick message_file_dirset chan [lindex [split $text] 0]if {"$text"==""} {putserv "notice $nick :Syntax: !delmsg #&lt;channel&gt; &lt;number&gt;"putserv "notice $nick :Use !listmsg #&lt;channel&gt;    to get line numbers"return 0}if {[validchan $chan]} {if {![file exists $message_file_dir${chan}]} {putserv "notice $nick :No message file exists yet, for $chan"putserv "notice $nick :The first time you use !enable to enable $chan, an empty message file will be created for $chan"return 0       }set del_line_num [expr [lindex [split $text] 1] - 1 ]if {$del_line_num &lt; 0} {putserv "notice $nick :No can do.  Must be 1 or greater."return 0} set phile [open $message_file_dir${chan} r]set data [read -nonewline $phile] close $phileset lines [split $data "\n"]      if {[llength $lines] &lt;= $del_line_num} {putserv "notice $nick :No such line number"return 0   }putserv "notice $nick :Deleting:  [join [lindex $lines $del_line_num]]"putserv "notice $nick :      (use  !listmsg   again now, as you may have changed the line numbers!)"set lines [lreplace $lines $del_line_num $del_line_num]set phile [open $message_file_dir${chan} "w"]puts $phile [join $lines "\n"]close $phile   } else {putserv "notice $nick :$chan is not a valid channel on $botnick"   }  }## Will enable timed messages announcements in the channel where the pub command is sentproc enable {nick uhost handle chan text} {global message_file_dirchannel set $chan +announcerif {([lsearch -exact [channel info $chan] {+announcer}] != -1)} {putserv "notice $nick :Timed Announcer enabled on $chan"if {![file exist $message_file_dir${chan}]} { close [open $message_file_dir${chan} w]}  }}# Via MSG - will enable timed message announcements in a channelproc msg_enable {nick uhost handle text} {global botnickif {"[lindex [split $text] 0]"==""} {putserv "notice $nick :Syntax: /msg $botnick !enable #&lt;channel&gt;"return 0   }if {[validchan [lindex [split $text] 0]]} {enable $nick $uhost $handle [lindex [split $text] 0] -fillerFortext-} else {putserv "notice $nick :[lindex [split $text] 0] is not a valid channel on $botnick"}}## Will disable timed message announcements in the channel where the pub command is sentproc disable {nick uhost handle chan text} {if {([lsearch -exact [channel info $chan] {+announcer}] != -1)} {channel set $chan -announcer     }if {([lsearch -exact [channel info $chan] {-announcer}] != -1)} {putserv "notice $nick :Timed Announcer disabled on $chan"}}# Via MSG - will disable timed message announcements in a channelproc msg_disable {nick uhost handle text} {global botnickif {"[lindex [split $text] 0]"==""} {putserv "notice $nick :Syntax: /msg $botnick !disnable #&lt;channel&gt;"return 0   }if {[validchan [lindex [split $text] 0]]} {disable $nick $uhost $handle [lindex [split $text] 0] -fillerFortext-} else {putserv "notice $nick :[lindex [split $text] 0] is not a valid channel on $botnick"}}## Send the status (enabled or disabled) to the channel where the pub command is givenproc status {nick uhost handle chan text} {set time_left 0foreach thetimer [timers] { if {[string match -nocase "run_announce*" [lindex $thetimer 1]]} { set time_left [lindex $thetimer 0]   }      }if {([lsearch -exact [channel info $chan] {+announcer}] != -1)} {putserv "notice $nick :Announcer is enabled in $chan."  if {$time_left} {putserv "notice $nick :Timer is running with $time_left minutes or less to go"}if !{$time_left} {putserv "notice $nick :Timer is not running"}} else {putserv "notice $nick :Timed Announcer is disabled in $chan"if {$time_left} {putserv "notice $nick :Timer is running with $time_left or less to go"}if !{$time_left} {putserv "notice $nick :Timer is not running"}}}# Via MSG -  statusproc msg_status {nick uhost handle text} {global botnickif {"[lindex [split $text] 0]"==""} {putserv "notice $nick :Syntax: /msg $botnick !status #&lt;channel&gt;"return 0   }if {[validchan [lindex [split $text] 0]]} {set time_left 0foreach thetimer [timers] { if {[string match -nocase "run_announce*" [lindex $thetimer 1]]} { set time_left [lindex $thetimer 0]   }      }if {([lsearch -exact [channel info [lindex [split $text] 0]] {+announcer}] != -1)} {putserv "notice $nick :Announcer is enabled in [lindex [split $text] 0]."  if {$time_left} {putserv "notice $nick :Timer is running with $time_left minutes or less to go"}if !{$time_left} {putserv "notice $nick :Timer is not running"}   } else {putserv "notice $nick :Timed Announcer is disabled in [lindex [split $text] 0]"if {$time_left} {putserv "notice $nick :Timer is running with $time_left or less to go"}if !{$time_left} {putserv "notice $nick :Timer is not running"}   }    } else {putserv "notice $nick :[lindex [split $text] 0] is not a valid chan on $botnick"   }}putlog "Loaded Timed Announcer   :)     See: http://forum.egghelp.org/viewtopic.php?p=93728#93728 "## Much credit goes to posters on the forum at   http://forum.egghelp.org/   ## Bits and pieces, and ideas used above - were borrowed from there.## To anyone not specifically mentioned, I apologize.## Any errors, broken code, poor code, or other strange things,  are not theirs.  They are mine.</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Aug 05, 2010 2:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-08-05T14:31:41-04:00</updated>

		<published>2010-08-05T14:31:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93774#p93774</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93774#p93774"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93774#p93774"><![CDATA[
<blockquote class="uncited"><div>Think I found an error...<br>From message #1 it jumped to #3, same from #3 to #5<br>...</div></blockquote>I may have found it.        Thanks for pointing it out.<br><br>Time will tell, as you continue to test and use it.<br>I'm about to post a newer version.  Let me know if it continues to do it, or if it is fixed.<br><br>But, this version does a little more.    <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br>I think you'll be interesting in trying it out.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Aug 05, 2010 2:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-08-05T11:30:24-04:00</updated>

		<published>2010-08-05T11:30:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93773#p93773</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93773#p93773"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93773#p93773"><![CDATA[
Yeah, that's really only good if your bot is only floating in a few channels. In my case, I know what channels my bot will float in and may possibly float in in the future, so I can use a method like this without issue. <br><br>As for your code, you're close. If you wanted to do it that way, use an elseif in place of that second if:<br><div class="codebox"><p>Code: </p><pre><code>    if {$chan eq "#Football"} { set phile [open $message_file1]  } elseif {$chan eq "#Football2"} { set phile [open $message_file2]  } else { set phile [open $message_file3]  }</code></pre></div>Willy is probably right about arrays, but I haven't used them in any of my scripts yet and they all respond within two seconds or so, depending on irc lag, etc. So the speed is acceptable to me. Probably more proper to use arrays though.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Thu Aug 05, 2010 11:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-08-05T09:26:23-04:00</updated>

		<published>2010-08-05T09:26:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93772#p93772</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93772#p93772"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93772#p93772"><![CDATA[
<blockquote class="uncited"><div>Like this?<br><br> if {$chan eq "#Football"} { <br>set phile [open $message_file1 "r"] <br> } <br>if {$chan eq "#Football2"}  { <br>set phile [open $messages_file2 "r"]<br>else {<br> set phile [open $message_file3"r"] <br> } <br>    <br>  </div></blockquote>Wouldn't that require that you know, before you write the script, the names of every channel that you might ever use it in?<br><br>If so, then no -  I'd prefer to not hardcode the names of channels into the script.<br>For what it is worth - I use arrays to hold the data, channel names, etc. ,<br>when I try to do something that is truly multi-channel.<br><br><br>I'm working on it, some.   I haven't forgotten it.    <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>If I have some success, I'll post it, and you'll be able to see how I did (attempted to do) it.<br><br>But don't hold your breath.   It all depends on how much time I have to play with it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Aug 05, 2010 9:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2010-08-05T07:46:56-04:00</updated>

		<published>2010-08-05T07:46:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93771#p93771</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93771#p93771"/>
		<title type="html"><![CDATA[Storage &amp; Display]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93771#p93771"><![CDATA[
Like this?<br><br> if {$chan eq "#Football"} { <br>set phile [open $message_file1 "r"] <br> } <br>if {$chan eq "#Football2"}  { <br>set phile [open $messages_file2 "r"]<br>else {<br> set phile [open $message_file3"r"] <br> } <br>    <br> <br> [/quote]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Thu Aug 05, 2010 7:46 am</p><hr />
]]></content>
	</entry>
	</feed>
