tglogo.png

Downloading File

Filename: Happy Birthday Greeter
on *:TEXT:!addbday*:#: {
  if ($nick !isop $chan) {
    .notice $nick [Birthday] Only Channel Operator's can add Birthday's!
    halt
  }
  if ($5 = $null) {
    .notice $nick [Birthday] Usage: $1 [nickname] [day] [month] [year]  (eg. $1 peter 01 04 1983)
    halt
  }
  var %bdayerror 0
  if ($3 < 1) var %bdayerror Date Too Low! (Only Allowed Between 1-31)
  if ($3 > 31) var %bdayerror Date Too High! (Only Allowed Between 1-31)
  if ($4 < 1) var %bdayerror Month Too Low! (Only Allowed Between 1-12)
  if ($4 > 12) var %bdayerror Month Too High! (Only Allowed Between 1-12)
  if ($5 < 1900) var %bdayerror Year Too Low! (Between 1900 and $asctime(yyyy) $+ )
  if ($5 > $asctime(yyyy)) var %bdayerror Year Too High! (Between 1900 and $asctime(yyyy) $+ )
  if (%bdayerror != 0) {
    .msg # [Age] Error: %bdayerror
    halt
  }
  .msg # [Birthday] Adding Birthday for $2 on Day $3 Month $4 and Year $5
  var %bdaydate $3 $+ - $+ $4 $+ - $+ $5
  var %bday $readini(Birthday.txt,Birthdays,%bdaydate)
  var %bday $remove(%bday,$2)
  writeini Birthday.txt Birthdays %bdaydate %bday $chr(32) $2
}
on *:TEXT:!howold*:#: {
  if ($4 = $null) {
    .notice $nick [Birthday] Usage: $1 [day] [month] [year]
    halt
  }
  var %bdayerror 0
  if ($2 < 1) var %bdayerror Date Too Low! (Only Allowed Between 1-31)
  if ($2 > 31) var %bdayerror Date Too High! (Only Allowed Between 1-31)
  if ($3 < 1) var %bdayerror Month Too Low! (Only Allowed Between 1-12)
  if ($3 > 12) var %bdayerror Month Too High! (Only Allowed Between 1-12)
  if ($4 < 1900) var %bdayerror Year Too Low! (Between 1900 and $asctime(yyyy) $+ )
  if ($4 > $asctime(yyyy)) var %bdayerror Year Too High! (Between 1900 and $asctime(yyyy) $+ )
  if (%bdayerror != 0) {
    .msg # [Age] Error: %bdayerror
    halt
  }
  var %bdaydate $2 $+ - $+ $3 $+ - $+ $4
  var %bdayyear $calc($asctime(yyyy) - $4)
  .msg # [Age] You are %bdayyear years old, Born $duration($calc($ctime - $ctime(%bdaydate))) ago.
}
on *:JOIN:#: {
  var %bdaydate $asctime(dd-mm-yyyy)
  var %bday $readini(Birthday.txt,Birthdays,%bdaydate)
  if (%bday != $null) .msg # Happy Birthday To: %bday - Hope you have a Great Day!
}

Related Files

by Vulcan
by ProIcons

Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand