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

	<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>2017-04-07T07:26:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[gembels]]></name></author>
		<updated>2017-04-07T07:26:50-04:00</updated>

		<published>2017-04-07T07:26:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106092#p106092</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106092#p106092"/>
		<title type="html"><![CDATA[Re: for]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106092#p106092"><![CDATA[
<blockquote class="uncited"><div>Hi gembels. Can you add a leading zero for one digit numbers to the text file and try again, i. e. 06 04 Hari Nelayan Nasional?</div></blockquote>aha.. got it... must be 2 digit... tha<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12028">gembels</a> — Fri Apr 07, 2017 7:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CP1832]]></name></author>
		<updated>2017-04-06T12:17:43-04:00</updated>

		<published>2017-04-06T12:17:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106085#p106085</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106085#p106085"/>
		<title type="html"><![CDATA[Re: for]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106085#p106085"><![CDATA[
Hi gembels. Can you add a leading zero for one digit numbers to the text file and try again, i. e. 06 04 Hari Nelayan Nasional?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12450">CP1832</a> — Thu Apr 06, 2017 12:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gembels]]></name></author>
		<updated>2017-04-06T09:39:07-04:00</updated>

		<published>2017-04-06T09:39:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106084#p106084</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106084#p106084"/>
		<title type="html"><![CDATA[Re: for]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106084#p106084"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>can you show us format for date.txt ? or sample data maybe ? or full version of your date.txt please</div></blockquote>Hi gembels. Here's a sample of my date.txt<div class="codebox"><p>Code: </p><pre><code>25 12 Merry Christmas!31 12 Happy new year!</code></pre></div>By the way, you can a couple of dates via command and see the format, then add yours manually.</div></blockquote><img src="http://image.prntscr.com/image/3abeac9e94f746abbdcb9ddfa94a7ba3.png" class="postimage" alt="Image"><br><br><img src="http://image.prntscr.com/image/ff25a77ee75645c4890fd6f3a7c712e7.png" class="postimage" alt="Image"><br><br>why is not working with that format ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12028">gembels</a> — Thu Apr 06, 2017 9:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CP1832]]></name></author>
		<updated>2016-06-08T00:52:19-04:00</updated>

		<published>2016-06-08T00:52:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105132#p105132</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105132#p105132"/>
		<title type="html"><![CDATA[Holiday / event topic changer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105132#p105132"><![CDATA[
<blockquote class="uncited"><div>[21:00] &lt;o_o&gt; [21:00:27] Tcl error [pubholiday]: invalid command name "checkUser"</div></blockquote>Sorry about that, I added that función to every públic command to avoid throttling from the users and forgot to delete that líne when I posted the code. I also replaced ${cmdchar} with dot as I have set cmdchar elsewhere.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12450">CP1832</a> — Wed Jun 08, 2016 12:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gamefan098]]></name></author>
		<updated>2016-06-07T16:42:09-04:00</updated>

		<published>2016-06-07T16:42:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105131#p105131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105131#p105131"/>
		<title type="html"><![CDATA[Holiday / event topic changer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105131#p105131"><![CDATA[
Np. I thanx for all the help that you give :)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12625">gamefan098</a> — Tue Jun 07, 2016 4:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2016-06-07T15:06:06-04:00</updated>

		<published>2016-06-07T15:06:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105129#p105129</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105129#p105129"/>
		<title type="html"><![CDATA[Holiday / event topic changer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105129#p105129"><![CDATA[
You get this error cos the function is missing from the original post. Can't help you with something i don't know. Sorry buddy.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jun 07, 2016 3:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gamefan098]]></name></author>
		<updated>2016-06-07T14:01:12-04:00</updated>

		<published>2016-06-07T14:01:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105128#p105128</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105128#p105128"/>
		<title type="html"><![CDATA[Holiday / event topic changer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105128#p105128"><![CDATA[
[21:00] &lt;o_o&gt; [21:00:27] Tcl error [pubholiday]: invalid command name "checkUser"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12625">gamefan098</a> — Tue Jun 07, 2016 2:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2016-06-07T12:50:32-04:00</updated>

		<published>2016-06-07T12:50:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105127#p105127</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105127#p105127"/>
		<title type="html"><![CDATA[Holiday / event topic changer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105127#p105127"><![CDATA[
Replace the:<div class="codebox"><p>Code: </p><pre><code>bind pub - ${cmdchar}date pubholiday </code></pre></div>line with:<div class="codebox"><p>Code: </p><pre><code>bind pub - !date pubholiday </code></pre></div>for instance if want to call the script like !date, or replace that ! with a . (dot) or whatever you want.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jun 07, 2016 12:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gamefan098]]></name></author>
		<updated>2016-06-07T11:21:22-04:00</updated>

		<published>2016-06-07T11:21:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105126#p105126</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105126#p105126"/>
		<title type="html"><![CDATA[Holiday / event topic changer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105126#p105126"><![CDATA[
<blockquote class="uncited"><div>[18:19] &lt;o_o&gt; [18:19:38] can't read "cmdchar": no such variable<br>[18:19] &lt;o_o&gt;     while executing<br>[18:19] &lt;o_o&gt; "bind pub - ${cmdchar}date pubholiday"<br>[18:19] &lt;o_o&gt;     (file "scripts/HolidayTopick.tcl" line 5)<br>[18:19] &lt;o_o&gt;     invoked from within<br>[18:19] &lt;o_o&gt; "source scripts/HolidayTopick.tcl"<br>[18:19] &lt;o_o&gt;     (file "eggdrop.conf" line 1431)<br>[18:19] &lt;o_o&gt; [18:19:38] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12625">gamefan098</a> — Tue Jun 07, 2016 11:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CP1832]]></name></author>
		<updated>2016-05-27T14:12:30-04:00</updated>

		<published>2016-05-27T14:12:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105044#p105044</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105044#p105044"/>
		<title type="html"><![CDATA[Re: for]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105044#p105044"><![CDATA[
<blockquote class="uncited"><div>can you show us format for date.txt ? or sample data maybe ? or full version of your date.txt please</div></blockquote>Hi gembels. Here's a sample of my date.txt<div class="codebox"><p>Code: </p><pre><code>25 12 Merry Christmas!31 12 Happy new year!</code></pre></div>By the way, you can a couple of dates via command and see the format, then add yours manually.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12450">CP1832</a> — Fri May 27, 2016 2:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gembels]]></name></author>
		<updated>2016-03-27T08:16:27-04:00</updated>

		<published>2016-03-27T08:16:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104852#p104852</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104852#p104852"/>
		<title type="html"><![CDATA[for]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104852#p104852"><![CDATA[
can you show us format for date.txt ? or sample data maybe ? or full version of your date.txt please<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12028">gembels</a> — Sun Mar 27, 2016 8:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CP1832]]></name></author>
		<updated>2016-06-08T00:46:10-04:00</updated>

		<published>2015-06-24T11:19:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104266#p104266</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104266#p104266"/>
		<title type="html"><![CDATA[Holiday / event topic changer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104266#p104266"><![CDATA[
I created a script so as to be able to change the channel's topic for a given date.<div class="codebox"><p>Code: </p><pre><code>foreach bind [binds topic_holiday] {lassign $bind type flags mask num proc; unbind $type $flags $mask $proc}foreach bind [binds pubholiday] {lassign $bind type flags mask num proc; unbind $type $flags $mask $proc}bind time - "00 00 * * *" topic_holidaybind pub - .date pubholidayset date_file "date.txt"if {![file exists $date_file]} {    fconfigure [set datefile [open $date_file w]] -encoding binary    close $datefile}proc topic_holiday {min hour day month year} {   global date_file   fconfigure [set datefile [open $date_file r]] -encoding binary   set today [clock format [clock seconds] -format "%d %m"]   set holidays [list]    while {![eof $datefile]} {set CurEntry "[gets $datefile]"        set date [lrange $CurEntry 0 1]        if {[string match -nocase $today $date]} {lappend holidays "[lrange $CurEntry 2 end]"   }   }   close $datefile   if {[string length $holidays] &gt; 0} {   foreach channel [channels] {if {[validchan $channel] &amp;&amp; [botonchan $channel] &amp;&amp; [botisop $channel]} {   putserv "TOPIC $channel :[join $holidays]"   }}   }putlog "Changing topic to [join $holidays]"}proc pubholiday {nick uhost hand chan text} {         set choice [lindex $text 0]set dd [lindex $text 1]set mm [lindex $text 2]set desc [lrange $text 3 end]if {[string equal -nocase "delete" $choice]} {        if {[GetDate $dd $mm] == "There are no events loaded for that date" || [GetDate $dd $mm] == "That date / month combination doesn't exist"} {        puthelp "PRIVMSG $chan :ERROR: [GetDate $dd $mm]"return 1}DeleteDate $dd $mm    puthelp "PRIVMSG $chan :$nick deleted $dd $mm"} elseif {[string equal -nocase "get" $choice]} {puthelp "PRIVMSG $chan :[GetDate $dd $mm]"return 1} elseif {[string equal -nocase "set" $choice]} {        if {$desc==""} {puthelp "PRIVMSG $chan :ERROR: Add a description for the event"return 1 }        if {[GetDate $dd $mm] == "That date / month combination doesn't exist"} {        puthelp "PRIVMSG $chan :ERROR: [GetDate $dd $mm]"return 1} elseif {[GetDate $dd $mm] != "There are no events loaded for that date"} {        puthelp "PRIVMSG $chan :ERROR: An event already exists for that date"return 1}SetDate $dd $mm "$desc"    puthelp "PRIVMSG $chan :Ahora: $dd $mm == [GetDate $dd $mm]"    return 1} else {puthelp "PRIVMSG $chan :\[DATE sintaxis\]"puthelp "PRIVMSG $chan :Use: .date get &lt;DD&gt; &lt;MM&gt; - Shows the event on the calendar for the specified date"puthelp "PRIVMSG $chan :Use: .date set &lt;DD&gt; &lt;MM&gt; &lt;Description&gt; - Changes the channel topic to &lt;Description&gt; on the specified date"puthelp "PRIVMSG $chan :Use: .date delete &lt;DD&gt; &lt;MM&gt; - Deletes the event on the calendar for the specified date"          puthelp "PRIVMSG $chan :\[DATE sintaxis\]"return 1}return 1}proc GetDate {dd mm} {regsub -all {[0-9]} $mm {1} myresultif {$myresult != 11 &amp;&amp; $myresult != 1 } {return "That date / month combination doesn't exist"}if {$myresult == 1 } {set mm 0$mm}if {$mm &gt; 12 || $mm == 0} {return "That date / month combination doesn't exist"}regsub -all {[0-9]} $dd {1} myresultif {$myresult != 11 &amp;&amp; $myresult != 1 } {return "That date / month combination doesn't exist"}if {$myresult == 1 } {set dd 0$dd}if {[string index $mm 0] eq 0} { set month [string index $mm 1] } else {set month $mm }        set days "31 29 31 30 31 30 31 31 30 31 30 31"        if {[lindex $days ${month}-1] &lt; $dd || $dd == 0} {        return "That date / month combination doesn't exist"        }    global date_file    fconfigure [set datefile [open $date_file r]] -encoding binary    set retval "There are no events loaded for that date"    set entry "$dd $mm"    while {![eof $datefile]} {set CurEntry "[gets $datefile]"set EntryName [string tolower [lrange $CurEntry 0 1]]if {$EntryName==$entry} {    set retval "[lrange $CurEntry 2 end]"}    }    close $datefile    return $retval}proc DeleteDate {dd mm} {    global date_file    regsub -all {[0-9]} $mm {1} myresult    if {$myresult == 1 } { set mm 0$mm }    regsub -all {[0-9]} $dd {1} myresult    if {$myresult == 1 } { set dd 0$dd }    fconfigure [set datefile [open $date_file r]] -encoding binary    set entry "$dd $mm"    while {![eof $datefile]} {set CurLine "[gets $datefile]"if {[lrange $CurLine 0 1]!=$entry} {lappend dateList $CurLine}    }    close $datefile    fconfigure [set datefile [open $date_file w]] -encoding binary    foreach CurLine $dateList {if {$CurLine!=""} {puts $datefile $CurLine}    }    close $datefile    SortDate 1}proc SetDate {dd mm definition} {    global date_file    regsub -all {[0-9]} $mm {1} myresult    if {$myresult == 1 } { set mm 0$mm }    regsub -all {[0-9]} $dd {1} myresult    if {$myresult == 1 } { set dd 0$dd }    set entry "$dd $mm"    set entry [string trim [string tolower $entry] \=]    fconfigure [set datefile [open $date_file r]] -encoding binary    while {![eof $datefile]} {set CurLine "[gets $datefile]"if {[lrange $CurLine 0 1]!=$entry} {    lappend dateList $CurLine}    }    close $datefile    fconfigure [set datefile [open $date_file w]] -encoding binary    foreach CurLine $dateList {if {$CurLine!=""} {puts $datefile $CurLine}    }    puts $datefile "$dd $mm $definition"    close $datefile    SortDate 1}proc SortDate {type} {global date_fileset t [clock clicks -milliseconds]fconfigure [set datefile [open $date_file r]] -encoding binaryset txt ""while {![eof $datefile]} {set tmp "[gets $datefile]"if {[info exists tmp]&amp;&amp;$tmp!=""} {set a [lindex $tmp 1][lindex $tmp 0]lappend txt [list $a $tmp]}}close $datefileset txt [lsort -index 0 $txt]fconfigure [set datefile [open $date_file w]] -encoding binaryforeach tmp $txt {puts $datefile [lindex $tmp 1]}close $datefileputlog "Sorting done of data on the database ($date_file)-&gt;[expr double([clock clicks -milliseconds]-$t)/1000]s"}putlog "Holiday topic changer... Loaded"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12450">CP1832</a> — Wed Jun 24, 2015 11:19 am</p><hr />
]]></content>
	</entry>
	</feed>
