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

	<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>2014-12-28T10:57:43-04:00</updated>

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

		<entry>
		<author><name><![CDATA[dutch1918]]></name></author>
		<updated>2014-12-28T10:57:43-04:00</updated>

		<published>2014-12-28T10:57:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103410#p103410</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103410#p103410"/>
		<title type="html"><![CDATA[TCL script help - us holiday check]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103410#p103410"><![CDATA[
I finally figured it out with some help... In case someone else is looking the same thing here is the code I came up with:<br><br>holiday.csv file<div class="codebox"><p>Code: </p><pre><code>Dec 25Christmas       US HolidayTrueJan 1New Year's DayUS HolidayTrueJan 19Martin Luther KingUS HolidayTrueFeb 16Presidents DayUS HolidayTrueApr 3Good Friday       US HolidayTrueMay 25Memorial Day       US HolidayTrueJul 3 Independance DayUS HolidayTrueSep 7Labor Day       US HolidayTrueNov 26Thanksgiving DayUS HolidayTrue</code></pre></div>bind cron script<br><div class="codebox"><p>Code: </p><pre><code>proc do_930_post {min hour day month weekday} {set holiday_file [open "holiday.csv" r]set holidays [list]while {[gets $holiday_file line] != -1} {    lappend holidays [lindex [split $line ,] 0]}set today [clock format [clock seconds] -timezone :America/New_York -format "%b %d"]lset today 1 [scan [lindex $today 1] %d]if {[lsearch -exact $holidays $today] &gt; -1} {    putserv "privmsg #options :\0030,4 09:30ET\0030,12 ((( US MARKET CLOSED -   US HOLIDAY ))) \017"putserv "privmsg #marketnews :\0030,4 09:30ET\0030,12 ((( US MARKET CLOSED -   US HOLIDAY ))) \017"} else {putserv "privmsg #options :\0030,4 09:30ET\0030,12 ((( US MARKET OPEN ))) \017"putserv "privmsg #marketnews :\0030,4 09:30ET\0030,12 ((( US MARKET OPEN ))) \017"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12417">dutch1918</a> — Sun Dec 28, 2014 10:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2014-12-08T09:55:30-04:00</updated>

		<published>2014-12-08T09:55:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103351#p103351</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103351#p103351"/>
		<title type="html"><![CDATA[TCL script help - us holiday check]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103351#p103351"><![CDATA[
Can you be more explicit about your need ? And about your .csv (ie date format) ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Dec 08, 2014 9:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dutch1918]]></name></author>
		<updated>2014-12-04T10:54:42-04:00</updated>

		<published>2014-12-04T10:54:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103347#p103347</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103347#p103347"/>
		<title type="html"><![CDATA[TCL script help - us holiday check]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103347#p103347"><![CDATA[
holiday.csv format<br>date,name,bank holiday,TRUE or FALSE<br><div class="codebox"><p>Code: </p><pre><code>proc do_930_post {min hour day month weekday} {global stockchanif {get date,TRUE/FALSE from holiday.csv and compare to todays date if TRUE then} {putserv "privmsg #swingtrader :\0030,4 09:30ET\0030,12 ((( US MARKET CLOSED - US HOLIDAY ))) \017"} else {putserv "privmsg #swingtrader :\0030,4 09:30ET\0030,12 ((( US MARKET OPEN ))) \017"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12417">dutch1918</a> — Thu Dec 04, 2014 10:54 am</p><hr />
]]></content>
	</entry>
	</feed>
