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

	<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>2019-03-08T02:48:54-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2019-03-08T02:48:54-04:00</updated>

		<published>2019-03-08T02:48:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107529#p107529</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107529#p107529"/>
		<title type="html"><![CDATA[Topic Day Change]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107529#p107529"><![CDATA[
Check this out! Regsub<div class="codebox"><p>Code: </p><pre><code>% proc swap args {        set topic "bla bla topic Thursday bla bla bla"        set days { Monday Tuesday Wednesday Thursday Friday Saturday Sunday }        foreach day $days {                regsub $day $topic newTopic        }}% time swap 100015.683 microseconds per iteration</code></pre></div>vs. string map<div class="codebox"><p>Code: </p><pre><code>% proc swap args {        set topic "bla bla topic Thursday bla bla bla"        set days { Monday Tuesday Wednesday Thursday Friday Saturday Sunday }        foreach day $days {                set newTopic [string map [list $day "foo"] $topic]        }}% time swap 10007.406 microseconds per iteration</code></pre></div>And if make a small change:<div class="codebox"><p>Code: </p><pre><code>% proc swap args {        set topic "bla bla topic Thursday bla bla bla"        set days { Monday Tuesday Wednesday Thursday Friday Saturday Sunday }        foreach day $days {                if {[string first $day $topic] &gt; -1} {                        set newTopic [string map [list $day "foo"] $topic]                        break                }        }}% time swap 10003.001 microseconds per iteration</code></pre></div>Btw, replace "foo" with $day <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Mar 08, 2019 2:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2019-03-07T16:23:35-04:00</updated>

		<published>2019-03-07T16:23:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107524#p107524</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107524#p107524"/>
		<title type="html"><![CDATA[Topic Day Change]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107524#p107524"><![CDATA[
<blockquote class="uncited"><div>Tried it. Adjusted it. Doesn't do anything come 24:00 or 24:01</div></blockquote>Which "it" did you try?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Mar 07, 2019 4:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dominatez]]></name></author>
		<updated>2019-03-07T16:08:08-04:00</updated>

		<published>2019-03-07T16:08:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107523#p107523</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107523#p107523"/>
		<title type="html"><![CDATA[Topic Day Change]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107523#p107523"><![CDATA[
Tried it. Adjusted it. Doesn't do anything come 24:00 or 24:01<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12783">Dominatez</a> — Thu Mar 07, 2019 4:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2019-02-27T10:49:41-04:00</updated>

		<published>2019-02-27T10:49:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107479#p107479</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107479#p107479"/>
		<title type="html"><![CDATA[Topic Day Change]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107479#p107479"><![CDATA[
<blockquote class="uncited"><div>... since he asked for every midnight.</div></blockquote>That he did.<br><br>However, I used [strftime %A] and am not sure what it will do right at midnight.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>So,  I set it for one minute more, and specifically noted it in comments.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed Feb 27, 2019 10:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2019-02-27T02:10:00-04:00</updated>

		<published>2019-02-27T02:10:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107476#p107476</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107476#p107476"/>
		<title type="html"><![CDATA[Topic Day Change]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107476#p107476"><![CDATA[
The cron mask should be {00 00 * * *} since he asked for every midnight.<br><div class="codebox"><p>Code: </p><pre><code>set working_chan "#channel" bind cron - {00 00 * * *} daily_topic_announce proc daily_topic_announce  {min hr day mo yr} {global working_chanif {![botonchan $working_chan] || ![botisop $working_chan]} returnset days { Monday Tuesday Wednesday Thursday Friday Saturday Sunday }set day [strftime %A]set topic [topic $working_chan]foreach day $days { regsub $day $topic newTopic }putserv "TOPIC $working_chan :[topic $newTopic]"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Feb 27, 2019 2:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2019-02-26T17:37:07-04:00</updated>

		<published>2019-02-26T17:37:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107475#p107475</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107475#p107475"/>
		<title type="html"><![CDATA[Topic Day Change]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107475#p107475"><![CDATA[
try  this :<br><div class="codebox"><p>Code: </p><pre><code>set working_chan "#channel" bind cron - {1 * * * *} daily_topic_announce proc daily_topic_announce  {min hr day mo yr} { global working_chan set day [strftime %A]putserv "TOPIC $working_chan :$day [topic $working_chan]" }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Tue Feb 26, 2019 5:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2019-02-25T18:03:07-04:00</updated>

		<published>2019-02-25T18:03:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107474#p107474</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107474#p107474"/>
		<title type="html"><![CDATA[Re: Topic Day Change]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107474#p107474"><![CDATA[
Try this.<br><div class="codebox"><p>Code: </p><pre><code># Feb. 25, 2019# http://forum.egghelp.org/viewtopic.php?t=20596### Is there a script that allows the bot to change the topic at 24:00## Example.## Today is Now Sunday. Welcome to our channel. Blah Blah Blah.## So everyday at midnight it will only change the day and leave the rest of the topic intact !###### Note:  With the current     bind cron - "1 0 * * *"  , it should trigger at 00:01 daily#### Set the channel that this script will work on.set working_chan "#your_channel_name_here"#bind cron - "1 0 * * *" daily_topic_announceproc daily_topic_announce {min hour day month weekday} {global working_chan        if {![botonchan $working_chan]} {                return 0        }        if {![botisop $working_chan]} {                return 0        }        if {[regsub Sunday [topic $working_chan] [strftime %A] outmsg]} {                putserv "topic $working_chan :$outmsg"                return 0        }        if {[regsub Monday [topic $working_chan] [strftime %A] outmsg]} {                putserv "topic $working_chan :$outmsg"                return 0        }        if {[regsub Tuesday [topic $working_chan] [strftime %A] outmsg]} {                putserv "topic $working_chan :$outmsg"                return 0        }        if {[regsub Wednesday [topic $working_chan] [strftime %A] outmsg]} {                putserv "topic $working_chan :$outmsg"                return 0        }        if {[regsub Thursday [topic $working_chan] [strftime %A] outmsg]} {                putserv "topic $working_chan :$outmsg"                return 0        }        if {[regsub Friday [topic $working_chan] [strftime %A] outmsg]} {                putserv "topic $working_chan :$outmsg"                return 0        }        if {[regsub Saturday [topic $working_chan] [strftime %A] outmsg]} {                putserv "topic $working_chan :$outmsg"                return 0        }}###</code></pre></div>And this looks kind of clunky.  Maybe somebody else here will have better / other ideas.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Mon Feb 25, 2019 6:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2019-02-25T12:44:40-04:00</updated>

		<published>2019-02-25T12:44:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107472#p107472</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107472#p107472"/>
		<title type="html"><![CDATA[Re: Topic Day Change]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107472#p107472"><![CDATA[
First:<br><br>Have you looked through all the topic related scripts found here?<br><a href="http://tclarchive.org/search.php?Topic" class="postlink">http://tclarchive.org/search.php?Topic</a><br><br>There are 42.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Mon Feb 25, 2019 12:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dominatez]]></name></author>
		<updated>2019-02-24T20:35:47-04:00</updated>

		<published>2019-02-24T20:35:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107470#p107470</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107470#p107470"/>
		<title type="html"><![CDATA[Topic Day Change]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107470#p107470"><![CDATA[
Is there a script that allows the bot to change the topic at 24:00 <br><br>Example.<br><br>Today is Now Sunday. Welcome to our channel. Blah Blah Blah.<br><br>So everyday at midnight it will only change the day and leave the rest of the topic intact !<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12783">Dominatez</a> — Sun Feb 24, 2019 8:35 pm</p><hr />
]]></content>
	</entry>
	</feed>
