/*    This is a little Pfile that can be run at log-on (In the sys.welcome)
   for instance) That will check to see if it is their Birthday, and if
   so Will Print a Happy Birthday Message to them. It will ALSO change
   their Who Banner for the Day to say "Its My Birthday Today!!!!"
   to let the other users on the system know. Then at the Next logon
   when the system determines its no longer their birthday Loads the
   Banner they had originally and restores it, then removes it from disk.
      
      This is my VERY first Arexx program!  So Im sure the code could be
   cleaned up significantly! I just needed such a program and was
   unable to find one anywhere, So I wrote this!
   
      This program is Shareware, I am ONLY asking $10.00 for this Program!
   I think that is more that reasonable for a program that will be used
   EVERY time a user calls your BBS! :) 
   
                    And if you order RIGHT now!!!!
                    
   you get FREE at no extra Charge!! the registered version that will
   include a couple more features.  First after the user is greeted with
   the ANSI screen they will be asked if they would like to see other
   users on the BBS that share their same birthyday. And secondly.. a 
   Stand-Alone program to put in your P-Files area or where ever that 
   allows any user at any time to see if any other users on the BBS share
   their same birthday. This is a $29.95 Value Absolutely FREE So order
   NOW! (Operators are standing by :)
 
   
      I can be Reached Via Snail-Mail at:
      
                             John Cruise
                             9679 S.W. Scory Lane
                             Stuart, Florida 34997
      Or Via Internet mail:                       
   
                          Chaos@sunken.gate.net
                          
      All else fails ya can reac me at Sunken Paradise BBS:
   
   18 LINE RINGDOWN! 
     879-9555 14.4 Ringdown   879-9556 28.8     879-6111 2400
        
   
   Thanks and I hope this program is of some use to you!      */

options results
bufferflush
TX=Transmit

call Main


Main:

	getuser 12 
	dt=result
	xd=left(dt,10)
	Date=right(xd,6)
	getuser 58 
	bd=result
	xx=left(bd,10)
	bday=right(xx,6)
	if bday = date then call Confirm 
	if bday ~= date then call not
    call goodbye
    
CONFIRM:

	getuser 1
	ans = result
	if exists('pfiles:birthdays/'ans'') then call screen
	getuser 38
	wbanner = result
	call open(file,'pfiles:birthdays/'ans'',"W")
	call writeln file, wbanner
	call close(file)
	sendstring 'L38 #Its My Birthday Today!!!!}'
	call screen


Screen:

tx 'c7z0r0f1                             c1            '
tx '        c4ÜÛÛÛÛÛÜ              c5º  º  º  º  º  º  º'
tx '       c4ÛÛÛÛÛÛÛÛÛ             c5º  º  º  º  º  º  º'
tx '       c4ÛÛÛÛÛÛÛÛÛ           c3ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ                c5ÜÛÛÛÛÛÜ'
tx '        c4ßÛÛÛÛÛß            c3ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ               c5ÛÛÛÛÛÛÛÛÛ'
tx '           \               c2ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ               c5ÛÛÛÛÛÛÛÛÛ'
tx '            \              c3ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ                c5ßÛÛÛÛÛß'
tx '             \             c3ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ                   \'
tx '              ø          c4ßßßßßßßßßßßßßßßßßßßßßßßßßßß                  c3\'
tx '                                                                       \'
tx '                   c1Â     Â  ÚÄÄÄ¿  ÂÄÄÄÄÄ¿ ÂÄÄÄÄÄ¿ Â     Â              ø'
tx '                   ³     ³  ³   ³  ³     ³ ³     ³ ³     ³'
tx '                   ÃÄÄÄÄÄ´ ÚÁÄÄÄÁ¿ ÃÄÄÄÄÄÙ ÃÄÄÄÄÄÙ ÀÄÄÄÄÄ´'
tx '                   ³     ³ ³     ³ ³       ³             ³'
tx '                   Á     Á Á     Á Á       Á       ÀÄÄÄÄÄÙ'
tx '  '
tx '        ÂÄÄÄÄ¿  ÄÄÄÂÄÄÄ ÂÄÄÄÄÄ¿ ÄÄÄÂÄÄÄ Â     Â ÂÄÄÄÄ¿   ÚÄÄÄ¿  Â     Â'
tx '        ³    ³     ³    ³     ³    ³    ³     ³ ³    À¿  ³   ³  ³     ³'
tx '        ÃÄÄÄÄÁ¿    ³    ÃÄÄÄÂÄÙ    ³    ÃÄÄÄÄÄ´ ³     ³ ÚÁÄÄÄÁ¿ ÀÄÄÄÄÄ´'
tx '        ³     ³    ³    ³   À¿     ³    ³     ³ ³    ÚÙ ³     ³       ³'
tx '        ÁÄÄÄÄÄÙ ÄÄÄÁÄÄÄ Á    ÀÄ    Á    Á     Á ÁÄÄÄÄÙ  Á     Á ÀÄÄÄÄÄÙ'
tx 'c7                           < Press Any Key >g1'

call goodbye

NOT:

   getuser 1
   ans=result
   if exists('pfiles:birthdays/'ans'') then call load
   call goodbye


LOAD:

    getuser 1
    ans = result
    call open(file,'pfiles:birthdays/'ans'',"R")
    rbanner=readln(file)
    getuser 38
    sendstring 'L38 #'rbanner'}'
    getuser 1
    log = result
    call close(file)
    sendstring '$0delete pfiles:birthdays/'log'}'
    call goodbye	

GOODBYE:

   bufferflush
   exit
