Birthday Script

By craighton on Oct 17, 2009

This script announces how old you are in the current channel by going "/age"

Make sure you put this in a new remotes window.

When you load it, it will ask you for your birthday in DAY/MONTH/YEAR form!

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@ Birthday Script                         @@@
;@@@ By Craighton                            @@@
;@@@ http://blog.logiclounge.net             @@@
;@@@ If you need help join                   @@@
;@@@ Server: irc.logiclounge.org             @@@
;@@@ Channel: #scripts                       @@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

on *:load:{ set %dob $$?="Please enter your Date of Birth in this format: day/month/year. $crlf $+ (i.e 14/3/83)" }
alias age {
  if ( $1 != $null ) {
    age.calc $duration($calc($ctime - $ctime($1)))
    msg $active You are %age.years years $+ , %age.weeks weeks $+ , and %age.days old.
  }
  else {
    age.calc $duration($calc($ctime - $ctime(%dob))) 
  msg $active I am %age.years years $+ , $calc(%age.weeks - 3 ) weeks $+ , and %age.days old!   }
unset %age.* }
alias age.calc {
  set %age.rawweeks $remove($$1,wks)
  set %age.days $2
  set %age.weeks $calc(%age.rawweeks % 52)
  set %age.years $calc((%age.rawweeks - %age.weeks) / 52)
}
alias age.setdob { set %dob $$?="Please enter your Date of Birth in this format: day/month/year. $crlf $+ (i.e  14/3/83)" }

Comments

Sign in to comment.
Lzy   -  Jan 23, 2011

Any way to allow this to take in to account the leap years as it has my age as being 5 days older than I really am.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.