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

	<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-14T01:22:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2019-03-13T16:33:16-04:00</updated>

		<published>2019-03-13T16:33:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107545#p107545</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107545#p107545"/>
		<title type="html"><![CDATA[Solved]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107545#p107545"><![CDATA[
1.) Cleaned up some... got rid of all the if lines... using strftime to determine day of week now.<br><br>2.) See comments in script below, on how to go about making such changes as you requested.<br><br>3.) Be sure to completely remove the previous script from bot.  To do that, do not simply .rehash.   Do .restart , after removing source line that loads previous script.<br><br>I hope this helps.     <br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br><br><br><div class="codebox"><p>Code: </p><pre><code># March 13, 2019# http://forum.egghelp.org/viewtopic.php?t=20606# Hello I wanna request tcl, function is on everyday bot advertise new texts, for example it should read from file like:# monday.txt# tuesday.txt# wednesday.txt# .....## on monday it repeats text from monday.txt and same goes on.. Anyone can give a try if possible?## March 13, 2019# Can you make little bit change, e.g on respective day, it Should Repeat Lines from .txt file every 60 min like this?# because I am to put many lines in each day file, so It should post line after every 60 min or 120 min from same day file.### Configuration #### Set the path to the directory where files to read are saved (must end with a / )set where_files_are "scripts/added/experimenting_for_somebody/daily_advertiser/"# Set the channel in which to announceset ad_chan "#your_chan_here"### End configuration ######bind cron - "0 * * * *" do_announce# Put this in Google: crontab "how to repeat every 60 minutes"# and it finds several things to read.# The first, and very simple one is :# https://crontab.guru/# and it says to use   "0 * * * *"  for every 60 minutes.# So, see above bind command line.  It is now that.  Need to let it run, to test it.## If you want to change it, feel free.  Just look it up with  https://crontab.guru/, edit the bind line while being sure to not change the format of# the line######proc do_announce {min hour day month weekday} {global where_files_are ad_chan        set fname [join "$where_files_are [string tolower [strftime %A]] .txt" ""]        if {![file exists $fname]} {                #putserv "privmsg $ad_chan :Sorry, $fname not found"                return 0        }        set fp [open $fname "r"]        set data [read -nonewline $fp]        close $fp        set lines [split $data "\n"]        foreach l $lines {                putserv "privmsg $ad_chan :$l"        }}# reference  :http://forum.egghelp.org/viewtopic.php?t=6885###</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed Mar 13, 2019 4:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hero]]></name></author>
		<updated>2019-03-13T12:52:27-04:00</updated>

		<published>2019-03-13T12:52:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107542#p107542</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107542#p107542"/>
		<title type="html"><![CDATA[Solved]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107542#p107542"><![CDATA[
willy, Thanks for quick reply, Can you make little bit change, e.g on respective day, it Should Repeat Lines from .txt file every 60 min like this?<br><br>because I am to put many lines in each day file, so It should post line after every 60 min or 120 min from same day file.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12019">Hero</a> — Wed Mar 13, 2019 12:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2019-03-13T10:37:36-04:00</updated>

		<published>2019-03-13T10:37:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107539#p107539</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107539#p107539"/>
		<title type="html"><![CDATA[Re: Request: Every Day New Text]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107539#p107539"><![CDATA[
Give this a try.   It has been tested only briefly - obviously to actually test it in use would take a week.  <br><div class="codebox"><p>Code: </p><pre><code># March 13, 2019# http://forum.egghelp.org/viewtopic.php?t=20606# Hello I wanna request tcl, function is on everyday bot advertise new texts, for example it should read from file like:# monday.txt# tuesday.txt# wednesday.txt# .....## on monday it repeats text from monday.txt and same goes on.. Anyone can give a try if possible?### Configuration #### Set the path to the directory where files to read are saved (must end with a / )set where_files_are "scripts/added/experimenting_for_somebody/"# Set the channel in which to announceset ad_chan "#your_chan_here"### End configuration ######bind cron - "0 12 * * 0" say_sundaybind cron - "0 12 * * 1" say_mondaybind cron - "0 12 * * 2" say_tuesdaybind cron - "0 12 * * 3" say_wednesdaybind cron - "0 12 * * 4" say_thursdaybind cron - "0 12 * * 5" say_fridaybind cron - "0 12 * * 6" say_saturday# The above binds will trigger at 12 noon daily.# For refence on how to adjust the time that a bind cron triggers, see:# https://crontab.guru/###proc say_sunday {min hour day month weekday} {global where_files_are ad_chan        if {$weekday == 0} {                set fname [join "$where_files_are sunday.txt" ""]        }         if {$weekday == 1} {                set fname [join "$where_files_are monday.txt" ""]        }         if {$weekday == 2} {                set fname [join "$where_files_are tuesday.txt" ""]        }         if {$weekday == 3} {                set fname [join "$where_files_are wednesday.txt" ""]        }         if {$weekday == 4} {                set fname [join "$where_files_are thursday.txt" ""]        }         if {$weekday == 5} {                set fname [join "$where_files_are friday.txt" ""]        }         if {$weekday == 6} {                set fname [join "$where_files_are saturday.txt" ""]        }        if {![file exists $fname]} {                ##putserv "privmsg $ad_chan :Sorry, $fname not found"                return 0        }        set fp [open $fname "r"]        set data [read -nonewline $fp]        close $fp        set lines [split $data "\n"]        foreach l $lines {                putserv "privmsg $ad_chan :$l"        }}# reference  :http://forum.egghelp.org/viewtopic.php?t=6885###</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed Mar 13, 2019 10:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Hero]]></name></author>
		<updated>2019-03-14T01:22:25-04:00</updated>

		<published>2019-03-13T08:53:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107538#p107538</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107538#p107538"/>
		<title type="html"><![CDATA[Solved]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107538#p107538"><![CDATA[
Hello I wanna request tcl, function is on everyday bot advertise new texts, for example it should read from file like: <br>monday.txt<br>tuesday.txt<br>wednesday.txt<br>.....<br><br>on monday it repeats text from monday.txt and same goes on.. Anyone can give a try if possible?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12019">Hero</a> — Wed Mar 13, 2019 8:53 am</p><hr />
]]></content>
	</entry>
	</feed>
