; Birthday.mrc 1.0 by JesseR ; http://www.angelfire.com/ca/jesser/scripts.html ; Keeps track of ppl's birthdays, and reminds you when someone's birthday is (roughly) within the next week ; Change this line to change how the script displays stuff alias -l e echo 7 -ia *Birthday* $1- ; If you don't want it to check automatically when you start mirc, comment out this line on 1:start:bdcheck on 1:load:bdhelp alias bdhelp { e Birthday Commands: e $chr(160) /bdadd nick month day e $chr(160) . /bdadd Uncle_Sam 7 4 e $chr(160) /bddel nick e $chr(160) /bdlist - lists everyone, soon in bold e $chr(160) /bdcheck - lists ppl with birthdays coming up e $chr(160) . (automatic each time you start mirc) e $chr(160) /bdhelp } alias bdadd { if ( $3 == $null ) { e /bdadd: Please use /bdadd Nick Month Day (/bdadd Jesus 12 25) halt } if ( $bday_have($1) ) { e Nick " $+ $1 $+ " already in birthday list (delete first to change). halt } bday_addtolist $1 bday_setdate $1 $2 $3 e Okay, added $1 ( $+ $bday_getufdate($1) $+ ). } alias bddel { if ( $bday_donothave($1) ) { e I don't have an entry for $1 $+ . halt } bday_remfromlist $1 bday_remdate $1 e Okay, removed $1 $+ . } alias bdcheck .bdlist alias bdlist { if ( %birthdays == $null ) { if ( $show ) e No entries. halt } if ( $show) e List ( $+ $gettok(%birthdays,0,32) $+ ): %birthdays set %i 1 :loop set %n $bday_getlistno(%i) if ( %n == $null ) { halt } if ( $bday_isnicksoon(%n) ) { e $chr(160)  $+ %n $+  $bday_getufdate(%n) } else { if ( $show) e $chr(160) %n $bday_getufdate(%n) } inc %i goto loop } ; these are internal functions/aliases alias bday_have { if ( $findtok(%birthdays,$$1,1,32) != $null ) return $true | return $false } alias bday_donothave { if ( $bday_have($$1) ) return $false | return $true } alias bday_addtolist { set %birthdays $addtok(%birthdays,$$1,32) } alias bday_remfromlist { set %birthdays $remtok(%birthdays,$$1,1,32) } alias bday_getlistno { return $gettok(%birthdays,$$1,32) } alias bday_setdate { set %birthdays. [ $+ [ $$1 ] ] $2 $3 } alias bday_remdate { unset %birthdays. [ $+ [ $$1 ] ] } alias bday_getdate { return %birthdays. [ $+ [ $$1 ] ] } alias bday_getufdate { return $replace($bday_getdate($1),$chr(32),/)) } alias bday_isnicksoon return $bday_issoon($bday_getdate($1)) ; decides whether a date is soon (after now) alias bday_issoon return $bday_isclose($asctime(m),$asctime(d),$1,$2) ; decides whether the second date is soon after the first date ; $bday_isclose(1,5,1,8) --> $true alias bday_isclose { if ( $1 == $3 ) { if ( $4 >= $2 && $calc($4 - $2) < 7 ) { return $true } return $false } unset %t if ( $calc($1 + 1) == $3 ) { set %t $true } if ( $1 == 12 && $3 == 1 ) { set %t $true } if ( %t == $true ) { if ( $calc($4 - $2 + 30) < 7 ) { return $true } return $false } return $false }