Birthday Greeter

By Truk on Mar 27, 2013

This is a nice script that says happy birthday to your chatters as they enter your chat for those people in your birthday list on the day of their birthday.

Birthdays are added via the command !addbday in the format (!addbday NickName 01 09) for a birthday of January 9th

If you have a birthday in the birthday data file for January 9th and any chatter joins the a channel on January 9th it will say happy birthday to your channel for NickName's birthday. Also if you have people joining your chat very often this could be very obnoxious. So I have it set to not fire more often than every 30 minutes. If you want to change the duration of the timer edit the line that looks like this: (set -eu1800 %bdayrun 1) to whatever value you like - the 1800 is in seconds.

This script is adapted from a script by Amiga600 and modified and changed significantly by me. Also dotcomboy17 helped with the timer :) Thanks guys!

Make sure to load this as a brand new script all by itself or it will not work!

;Birthdays are added via the command !addbday in the format (!addbday NickName 01 09) for a birthday of January 9th

;If you have a birthday in the birthday data file for January 9th and any chatter joins the a channel on January 9th it will say happy birthday to your channel for NickName's birthday.  Also if you have people joining your chat very often this could be very obnoxious.  So I have it set to not fire more often than every 30 minutes.  If you want to change the duration of the timer edit the line that looks like this:  (set -eu1800 %bdayrun 1) to whatever value you like - the 1800 is in seconds.

;This script is adapted from a script by Amiga600 and modified and changed significantly by me. Also dotcomboy17 helped with the timer :)  Thanks guys!

;Make sure to load this as a brand new script all by itself or it will not work!
on *:TEXT:!addbday*:#: {
  if ($nick !isop $chan) {
    .notice $nick [Birthday] Only Channel Operator's can add Birthday's!
    halt
  }
  if ($4 = $null) {
    .notice $nick [Birthday] Usage: $1 [nickname] [month] [day] DO NOT enter a year  (eg. $1 peter 01 09 for Jan 09)
    halt
  }
  var %bdayerror 0
  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 < 1) var %bdayerror Date Too Low! (Only Allowed Between 1-31)
  if ($4 > 31) var %bdayerror Date Too High! (Only Allowed Between 1-31)
  if (%bdayerror != 0) {
    .msg # [Age] Error: %bdayerror
    halt
  }
  .msg # [Birthday] Adding Birthday for $2 on Month $3 Day $4
  var %bdaydate $3 $+ - $+ $4
  var %bday $readini(Birthday.txt,Birthdays,%bdaydate)
  var %bday $remove(%bday,$2)
  writeini Birthday.txt Birthdays %bdaydate %bday $chr(32) $strip($2,burcmo)
}
on *:JOIN:#: {
  if (%bdayrun = $null) {
    if (ustreamer isin $nick) { halt }
    set -eu1800 %bdayrun 1
    var %bdaydate $asctime(mm-dd)
    var %bday $readini(Birthday.txt,Birthdays,%bdaydate)
    if (%bday != $null) .msg # Happy Birthday To: $strip(%bday,burcmo) - Hope you have a Great Day!
  }
}

Comments

Sign in to comment.
  -  Aug 12, 2014

I'm using a bot in my channel (mIRC6.35) Trying to use it from there but is not working? testing it with bot (not channel operator and entering:
!addbday John 08 12 also tried !addbday $1 John 08 12
only this appears in main window [16:23] !addbday Peter 08 12 (Stats have mode +B only)
not even receiving the message [Birthday] Only Channel Operator's can add Birthday's!
I'm new at this so does it work in a bot on the channel is it usable as is in mirc 6.35?
Please help I've been looking all over for something like this>

 -  Aug 12, 2014

also tried !addbday $1 John 08 12

Resinator  -  Aug 13, 2014

There is no way to answer this question without seeing the script you are running on the bot and knowing what you are trying to accomplish.

Truk  -  Aug 13, 2014

I assume you know that you cannot do the !addbday John 08 12 from the bot itself but it has to be from another chat session try having the bot running and start another chat program instance and try it from a nickname other than the bot's nick. Hope this helps. I just confirmed it will do nothing if you try the !addbday from the bot - notta-nuttin

 -  Aug 13, 2014

Thank you Truk will try that and see. Will get back to you on that
Resinator I used the script as is from Truk http://hawkee.com/snippet/9892/

Resinator  -  Aug 13, 2014

you have to type !addbday Peter 08 12

  • must not be typing it from the bot (machine running the script)
  • must have operator status (@) to add birthdays
Ablekie  -  Aug 29, 2014

Any way that you can add a routine to also delete a birthday? I'm newby and tried but no go. like:
n :TEXT:!delbday:#: {
if ($nick !isop $chan) {
.notice $nick [Birthday] Only Channel Operator's can add Birthday's!
halt
??????

Sign in to comment

Vegito   -  Apr 03, 2014

You can use $ctime to check for a valid date.

!addbday vegito 2 31 this will be valid in your script while it shouldn't.

 Respond  
Lozo   -  Mar 10, 2014

I quite like this script, very good I must say and I am glad to have helped!

Truk  -  Mar 12, 2014

:) I quite like it too - perfect for that cozy chat channel. And TY as always!!

Sign in to comment

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.