read text file and display matches, please help - 07/03/06 07:02 AM
I have the following birthdays script, but want to add a !today command that will cause it to scan the list and respond "The following people are having a birthday today: name1, name2 etc"
I know this is probably very easy to do, but beyond my limited abilities. I'd appreciate some help!
I know this is probably very easy to do, but beyond my limited abilities. I'd appreciate some help!
Code:
on *:TEXT:!addbirth *:#:{ If ($2 isnum) && ($3 isalpha) { if $read(birthday.txt,s,$nick) { msg $chan $nick your birthday has already been recorded } else { msg # $nick your birthday has been saved. | .write birthday.txt $nick $2- } } else { msg $chan Please use this format: !addbirth day month - e.g. !addbirth 28 February } } on *:TEXT:!birthday *:#:{ If ($read(birthday.txt,s,$2)) { msg # $2 was born on $ifmatch } | else { msg # No Birthday details for $2 } } on *:join:#:{ var %bday = $read(birthday.txt,s,$nick) if ($gettok(%bday,1,32) == $date(dd)) && ($left($gettok(%bday,2,32),3) == $date(mmm)) { .timer 1 6 describe # wishes $nick a Happy Birthday!!! } }