@program birthdays.muf 1 1000 d i $def DATE "%m/%d" systime timefmt $def BDAY "/@/bday" $include $lib/alynna lvar param : main var tmp var target param ! param @ "connect" smatch if "" param ! then param @ tolower case "#help" smatch when { "Birthdays by Alynna Trypnotk" " " " bday #on Allow your birthday to be announced" " bday #off Dont announce your birthday (default)" " bday #non Notify you of birthdays on login (default if supported)" " bday #noff Dont notify you of birthdays" " bday Show today's birthdays" " bday MM/DD Show birthdays for that day" " bday Show birthday for that person, if listed (bday #on)" } array_make atellme end "#on" smatch when me @ "/@/bday-ann" "yes" setprop "You have just turned your birthday announcement ON." "Birthday" pretty tellme end "#off" smatch when me @ "/@/bday-ann" "no" setprop "You have just turned your birthday announcement OFF." "Birthday" pretty tellme end "#non" smatch when me @ "/_/bday-ann" "yes" setprop "You have just turned your birthday notification ON." "Birthday" pretty tellme end "#noff" smatch when me @ "/_/bday-ann" "no" setprop "You have just turned your birthday notification OFF." "Birthday" pretty tellme end default command @ "Queued event." smatch if me @ "/_/bday-ann" getpropstr "n*" smatch if exit then then command @ "Queued event." smatch if 5 sleep then param @ not if { "Today is " "%m/%d/%Y" systime timefmt " and today is " #-1 "*" "P" find_array BDAY DATE "*" strcat array_filter_prop "/@/bday-ann" "y*" array_filter_prop { }array tmp ! dup array_count if foreach swap pop name tmp @ array_appenditem tmp ! repeat tmp @ ", " array_join else depth popn exit then "'s birthday!" }cat "Birthday" pretty tellme exit then param @ "/" instr not if param @ resolve target ! target @ int 0 < if "Invalid or insoluable reference" "Birthday" pretty tellme exit then { target @ "'s birthday is: " target @ "/@/bday-ann" getpropstr "y*" smatch if target @ BDAY getpropstr "/" rsplit pop else "Not listed" then }cat "Birthday" pretty tellme exit then param @ "/" instr if { "Birthdays on " param @ ": " #-1 "*" "P" find_array BDAY param @ "*" strcat array_filter_prop "/@/bday-ann" "y*" array_filter_prop { }array tmp ! dup array_count if foreach swap pop name tmp @ array_appenditem tmp ! repeat tmp @ ", " array_join else pop "Noone" then }cat "Birthday" pretty tellme exit then end endcase ; . c q