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

	<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>2009-01-04T04:52:17-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Torrevado]]></name></author>
		<updated>2009-01-04T04:52:17-04:00</updated>

		<published>2009-01-04T04:52:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86720#p86720</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86720#p86720"/>
		<title type="html"><![CDATA[bind time proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86720#p86720"><![CDATA[
Thanks for your great explanation, arfer  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8047">Torrevado</a> — Sun Jan 04, 2009 4:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-01-03T19:14:21-04:00</updated>

		<published>2009-01-03T19:14:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86717#p86717</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86717#p86717"/>
		<title type="html"><![CDATA[bind time proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86717#p86717"><![CDATA[
As an example, this is a small script that outputs a GMT time message on the hour every hour to all the bot's channels. ie. at 00 minutes<br><br>bind TIME - "00 * * * *" prcClock<br><br>proc prcClock {minute hour day month year} {<br>    set now [split [regsub {[\s][\s]} [clock format [clock seconds] -format "%A %e %B %G %I:%M%p" -gmt 1] " "]]<br>    switch -- [lindex $now 1] {<br>        1 - 21 - 31 {set now [lreplace $now 1 1 "[lindex $now 1]st"]}<br>        2 - 22 {set now [lreplace $now 1 1 "[lindex $now 1]nd"]}<br>        3 - 23 {set now [lreplace $now 1 1 "[lindex $now 1]rd"]}<br>        default {set now [lreplace $now 1 1 "[lindex $now 1]th"]}<br>    }<br>    set now [lreplace $now end end [string tolower [lindex $now end]]]<br>    foreach chan [channels] {<br>        putserv "PRIVMSG $chan :GMT (UTC) (0\xB0) [join $now]"<br>    }<br>}<br><br>The channel output is typically as follows :-<br><br>GMT (UTC) (0°) Saturday 3rd January 2009 11:00pm<br><br>I hope this helps<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sat Jan 03, 2009 7:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-01-03T18:54:16-04:00</updated>

		<published>2009-01-03T18:54:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86716#p86716</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86716#p86716"/>
		<title type="html"><![CDATA[bind time proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86716#p86716"><![CDATA[
Firstly, the minute mask of a time bind is padded to 2 characters. Therefore you need :-<br><br>bind time - "01 * * * *" testing<br><br>Secondly, a time bind returns arguments to the corresponding proc as follows :- <br><br>proc testing {minute hour day month year} {<br># code here<br>}<br><br>You cannot pick and choose what information a bind passes as proc arguments, but you can name the arguments anything you like.<br><br>Note that the irc channel is not passed to the proc. This ought to be obvious since a time bind executes independently of IRC channels. It is not an IRC event.<br><br>You will have to find some way of storing channel name(s) in a variable and passing the variable globally to the proc OR use something like the following code inside the proc :-<br><br>foreach chan [channels] {<br># IRC output code here<br>}<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sat Jan 03, 2009 6:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Torrevado]]></name></author>
		<updated>2009-01-03T18:14:10-04:00</updated>

		<published>2009-01-03T18:14:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86715#p86715</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86715#p86715"/>
		<title type="html"><![CDATA[bind time proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86715#p86715"><![CDATA[
Hi,<br>I need a script to make the bot send a message to a channel past 1 minute of each hour (that is 01:01, 02:01, 03:01..etc).<div class="codebox"><p>Code: </p><pre><code>bind time - "1 * * * *" testing  proc testing {testing chan text time} {   putserv "PRIVMSG $chan :\002Message goes here!!\002" }</code></pre></div>Of course, it doesn't work<br>So, if this code works:<div class="codebox"><p>Code: </p><pre><code>bind pub - !testing testing proc testing {nick host handle chan text} {  putserv "PRIVMSG $chan :\002Message goes here!!\002"}</code></pre></div>Why doesn't the other one?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8047">Torrevado</a> — Sat Jan 03, 2009 6:14 pm</p><hr />
]]></content>
	</entry>
	</feed>
