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

	<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>2005-08-07T11:56:08-04:00</updated>

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

		<entry>
		<author><name><![CDATA[dusk]]></name></author>
		<updated>2005-08-07T11:56:08-04:00</updated>

		<published>2005-08-07T11:56:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53811#p53811</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53811#p53811"/>
		<title type="html"><![CDATA[Problem solved]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53811#p53811"><![CDATA[
Finally I'v found the problem.<br><br>It seems the problem was that the script removed the zero if u entered for example 19/02/1977 &lt;--- it removed the 0 before the 2 (same for the days) and it seems 2 is recognized in the equasion as GREATER than for example 08 ($systemmonth) ????? Weird.<br><br>So I just removed these lines : <div class="codebox"><p>Code: </p><pre><code>    if {[string index $month 0] == 0} {set month [string index $month 1]    }    if {[string index $day 0] == 0} {set day [string index $day 1]    }</code></pre></div>And put a "0" before all months below 10 in the humanmonth proc at the end of the script.<br><br>Works like a charm again, just don't understand why it worked before...?<br><br>Thx anyway <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=6042">dusk</a> — Sun Aug 07, 2005 11:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-08-07T11:40:16-04:00</updated>

		<published>2005-08-07T11:40:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53807#p53807</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53807#p53807"/>
		<title type="html"><![CDATA[asl thingy]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53807#p53807"><![CDATA[
nope, it's not too slow hehehe<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sun Aug 07, 2005 11:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dusk]]></name></author>
		<updated>2005-08-07T07:40:14-04:00</updated>

		<published>2005-08-07T07:40:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53799#p53799</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53799#p53799"/>
		<title type="html"><![CDATA[datafile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53799#p53799"><![CDATA[
I've checked the datafile over and over again, even erased it en tested with some new entries....still the same problem. <br><br>Could it be the incr is too slow?<br><br>if {$month &lt; $systemmonth} { incr age } <br>          if {$month == $systemmonth} { <br>         if {$day &lt; $systemday} { incr age } <br><br>thx<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6042">dusk</a> — Sun Aug 07, 2005 7:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-08-07T03:54:46-04:00</updated>

		<published>2005-08-07T03:54:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53796#p53796</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53796#p53796"/>
		<title type="html"><![CDATA[asl thingy]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53796#p53796"><![CDATA[
this is an awfully written script but nevertheless its age arithmetic is correct; therefore, the reason for displaying incorrect data could only be incorrect data file, so you should inspect data file entries leading to incorrect results<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sun Aug 07, 2005 3:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dusk]]></name></author>
		<updated>2005-08-06T13:21:52-04:00</updated>

		<published>2005-08-06T13:21:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53773#p53773</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53773#p53773"/>
		<title type="html"><![CDATA[unixtime]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53773#p53773"><![CDATA[
thus.... the [unixtime] should be the problem then? any idea how to change the code so this thing could work properly again?<br><br>THX<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6042">dusk</a> — Sat Aug 06, 2005 1:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2005-08-06T12:20:02-04:00</updated>

		<published>2005-08-06T12:20:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53770#p53770</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53770#p53770"/>
		<title type="html"><![CDATA[asl thingy]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53770#p53770"><![CDATA[
Err yeah thats what I meant. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> I had problems with the date function in php a while back.<br><blockquote class="uncited"><div>date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Sat Aug 06, 2005 12:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dusk]]></name></author>
		<updated>2005-08-06T12:15:17-04:00</updated>

		<published>2005-08-06T12:15:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53769#p53769</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53769#p53769"/>
		<title type="html"><![CDATA[no windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53769#p53769"><![CDATA[
Nope, I'm using this with eggdrop 1.6.17 <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> (5eggs on 3 different servers), and that's just the weird thing about it, it worked fine for 2 months.<br><br>thx<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6042">dusk</a> — Sat Aug 06, 2005 12:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-08-06T12:11:52-04:00</updated>

		<published>2005-08-06T12:11:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53766#p53766</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53766#p53766"/>
		<title type="html"><![CDATA[asl thingy]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53766#p53766"><![CDATA[
well, the [unixtime] starts on Jan 1st, 1970 <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sat Aug 06, 2005 12:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2005-08-06T12:04:06-04:00</updated>

		<published>2005-08-06T12:04:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53764#p53764</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53764#p53764"/>
		<title type="html"><![CDATA[asl thingy]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53764#p53764"><![CDATA[
If you are running this on a windrop then just to let you know that windows does not handle dates properly before 1970 if using a mysql date time or unixtime format.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Sat Aug 06, 2005 12:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dusk]]></name></author>
		<updated>2005-08-06T10:33:24-04:00</updated>

		<published>2005-08-06T10:33:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53756#p53756</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53756#p53756"/>
		<title type="html"><![CDATA[asl thingy]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53756#p53756"><![CDATA[
Weird thing happened......I'm using 'asl thingy v1.02' for age/sex/location input in my channel. Everything worked just fine untill last wednesday, suddenly the script returned (for some users) their age minus 1.<br><br>for example : <br><br>!asladd dusk m/somewhere 23/02/1977<br>the script returns : dusk is 27 (MUST be 28 ) years old, his anniversary : 23 feb<br>First I thought there was a problem with the clock on the server wich I'm using a shell on, but bots who are placed on another server (other provider) suddenly reacted the same way.Altough there was no problem before (and I didn't change the code either)<br><br>This is the script (partial) : Maybe if someone could take a look....<br> <br><div class="codebox"><p>Code: </p><pre><code># create the data file if it doesn't existif {![file exist $asl_storefile]} {    set create [open $asl_storefile a+]    close $create}# load the data in memorycatch { unset asl_entries }set asl_file [open $asl_storefile]while {![eof $asl_file]} {    lappend asl_entries [string tolower [lindex [gets $asl_file] 0]]}close $asl_filebind pub $asl_addflag $asl_addtrig asl_addbind pub $asl_delflag $asl_deltrig asl_delbind pub $asl_flag $asl_trig asl_search# add infoproc asl_add {nick host handle chan arg} {    global asl_storefile asl_addtrig asl_entries    if {[lindex $arg 2] == ""} {puthelp "notice $nick :USAGE: $asl_addtrig &lt;nick&gt; &lt;sex/location&gt; &lt;date&gt;"    } {set entry [string tolower [lindex $arg 0]]# create the data file if it doesn't existif {![file exist $asl_storefile]} {    set create [open $asl_storefile a+]    close $create    catch { unset asl_entries }}if {[lsearch -exact $asl_entries $entry] == -1} {    if {![isvaliddate [lindex $arg 2]]} {puthelp "notice $nick :USAGE: $asl_addtrig &lt;nick&gt; &lt;sex/location&gt; &lt;date&gt;"puthelp "notice $nick :[lindex $arg 2] is geen geldige datum!"return 0    }    if {![isvalidasl [lindex $arg 1]]} {puthelp "notice $nick :USAGE: $asl_addtrig &lt;nick&gt; &lt;sex/location&gt; &lt;date&gt;"puthelp "notice $nick :[lindex $arg 1] is geen geldig &lt;sex/locatie&gt;"return 0    }    lappend asl_entries $entry    set file [open $asl_storefile a+]    puts $file $arg    close $file    putserv "notice $nick :Info van [lindex $arg 0] werd opgeslagen!"} {    putserv "notice $nick :Info over [lindex $arg 0] werd reeds opgeslagen!"}    }}# delete infoproc asl_del {nick host handle chan arg} {    global asl_storefile asl_tempfile asl_deltrig asl_entries    if {[lindex $arg 1] != "" || [lindex $arg 0] == ""} {putserv "notice $nick :GEBRUIK: $asl_deltrig &lt;nick&gt;"    } {set entry [string tolower $arg]# create the data file if it doesn't existif {![file exist $asl_storefile]} {    set create [open $asl_storefile a+]    close $create    catch { unset asl_entries }    putserv "notice $nick :Geen info over $arg gevonden!"    return 0}set idx [lsearch -exact $asl_entries $entry]if {$idx != -1} {    set asl_entries [lreplace $asl_entries $idx $idx]    set file [open $asl_storefile]    set tempfile [open $asl_tempfile w]    while {![eof $file]} {set temp [gets $file]if {[string tolower [lindex $temp 0]] != $entry &amp;&amp; $temp != ""} {    puts $tempfile $temp}    }    close $file    close $tempfile    file delete $asl_storefile    file rename $asl_tempfile $asl_storefile    putserv "notice $nick :deleted info for $arg"} {    putserv "notice $nick :Geen info gevonden over $arg ."}    }}# search for infoproc asl_search {nick host handle chan arg} {    global asl_storefile asl_entries    # create the data file if it doesn't exist    if {![file exist $asl_storefile]} {set create [open $asl_storefile a+]close $createcatch { unset asl_entries }return 0    }    set entry [string tolower [lindex $arg 0]]    if {$entry == ""} { return 0 }        if {[lsearch -exact $asl_entries $entry] != -1} {set file [open $asl_storefile]while {![eof $file]} {    set line [gets $file]    set matchnick [string tolower [lindex $line 0]]    if {$entry == $matchnick} {set rnick [lindex $line 0]set asl [lindex $line 1]set date [lindex $line 2]if {[isvalidasl $asl]} {    set location [lindex [split $asl "/"] 1]    set sex [lindex [split $asl "/"] 0]    if {$sex == "m" || $sex == "M"} {set heshe "Hij"    } {set heshe "Ze"    }} {    puthelp "privmsg $chan :$nick, $rnick's info is corrupt :/"    close $file    return 0}if {[isvaliddate $date]} {    set splitted [split $date "/"]    set day [lindex $splitted 0]    set month [lindex $splitted 1]    set year [lindex $splitted 2]    if {[string index $month 0] == 0} {set month [string index $month 1]    }    if {[string index $day 0] == 0} {set day [string index $day 1]    }    set systemday [clock format [unixtime] -format %d]    set systemmonth [clock format [unixtime] -format %m]    set systemyear [clock format [unixtime] -format %Y]    set age [expr $systemyear - $year -1]    if {$month &lt; $systemmonth} { incr age }    if {$month == $systemmonth} {if {$day &lt; $systemday} { incr age }    }} {    puthelp "privmsg $chan :$nick, $rnick's info is corrupt :/"    close $file    return 0}puthelp "privmsg $chan :$nick, $rnick is $age jaar. $heshe woont in $location en is jarig op $day [humanmonth $month] ."close $filereturn 0    }}close $file    }    puthelp "privmsg $chan :$nick, geen info over [lindex $arg 0]"}# checkt of een string een geldige 'sex/location' isproc isvalidasl {string} {    set splittedasl [split $string "/"]    if {[llength $splittedasl] != 2} { return 0 }    set sex [lindex $splittedasl 0]    if {$sex != "m" &amp;&amp; $sex != "v" &amp;&amp; $sex != "f" &amp;&amp;$sex != "M" &amp;&amp; $sex != "V" &amp;&amp; $sex != "F"} {return 0    }    return 1}# checkt of een string een geldige datum voorstelt in dd/mm/yyyy# (schrikkeljaren buiten beschouwen gelaten :p)proc isvaliddate {string} {    set splitteddate [split $string "/"]    if {[llength $splitteddate] != 3} { return 0 }    foreach num $splitteddate {if {![isnumber $num]} { return 0 }    }    set day [lindex $splitteddate 0]    set month [lindex $splitteddate 1]    set year [lindex $splitteddate 2]    if {[string length $year] != 4} { return 0 }    if {$day &gt; 31 || $day == 0} { return 0 }    if {$month &gt; 12 || $month == 0} { return 0 }        switch $month {2 { if {$day &gt; 29} { return 0 } }4 -6 -9 -11 { if {$day &gt; 30} { return 0 } }    }    return 1}# zet getal 1-12 om naar de corresponderende maandproc humanmonth {num} {    switch $num {1 { return "januari" }2 { return "februari" }3 { return "maart" }4 { return "april" }5 { return "mei" }6 { return "juni" }7 { return "juli" }8 { return "augustus" }9 { return "september" }10 { return "oktober" }11 { return "november" }12 { return "december" }    }}putlog "asl thingy v1.02 loaded .."## EOF</code></pre></div>First I thought this was the problem, but it seems fine (also weird it doesn't affect ALL users, just some of them)<br><div class="codebox"><p>Code: </p><pre><code>    set age [expr $systemyear - $year -1]    if {$month &lt; $systemmonth} { incr age }    if {$month == $systemmonth} {if {$day &lt; $systemday} { incr age }</code></pre></div>Thx in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6042">dusk</a> — Sat Aug 06, 2005 10:33 am</p><hr />
]]></content>
	</entry>
	</feed>
