/*
------------------------------------------------------------------------
                 Oves SommarHus BBS +46-(0)16-146837 
  $VER: BirtDayGift.Rexx 1.0 (14-10-95) Snille Of LoserKlubben.inc
------------------------------------------------------------------------

Description:  Gives the user a present on the birthday...

Requirements: CNet 3.05

Install:      Just put #0Pfiles:Birth.rexx} in your sys.Welcome.
              Do not forget to change the Edit name, bday, sex 
              Privilege flag to NO. Otherwise the user can change 
              his birthdate.

Mail me at:   E-Mail:
              erik.pettersson@mailbox.swipnet.se

------------------------------------------------------------------------
*/

options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
tr=transmit ; se=sendstring ; gc=getchar ; gu=getuser ; gs=getscratch
a='rexxsupport.library' ; if ~show('l',a) then if ~addlib(a,0,-30) then exit

/* ---------------------- Config your gift here! ---------------------- */

BGift=1000000   /* Bytes that user Recives */
FGift=10        /* Files that user Recives */

/* -------------------------------------------------------------------- */

Options Results
GETUSER 1500410 ; BirthDate=Result
GETUSER 1500000 ; Today=Result
GETUSER 1200016 ; Age=Result
GETUSER 1400504 ; BCredits=Result
GETUSER 1400500 ; FCredits=Result
GETUSER 1200536 ; Calls=Result

BDate = Left(BirthDate,10)
BDate = Right(BDate,6)

TDate = Left(Today,10)
TDate = Right(TDate,6)

If TDate=BDate then do
	If Calls>1 Then do
		Transmit "c3n1HAPPY BIRTHDAY c2again... But you can only collect c3ONE c2gift/year!c7"
		Transmit "n1Press Any KeyG1}"
		Exit
	End

	Transmit "c2HAPPY BIRTHDAY TO YOU,n1HAPPY BIRTHDAY TO YOU,n1HAPPY BIRTHDAY DEAR c3V1}c2,n1HAPPY BIRTHDAY TO YOU.n1"
	Transmit "c6Congratulations, you have reached the age ofc3 "Age"c6."
	Transmit "n1c6As a gift you will recieve:n1c3"BGift" c2Bytesn1c3"FGift" c2Filesc7"
	
	BGift=BCredits+BGift
	Setobject BGift
	PutUser 1400504

	FGift=FCredits+FGift
	Setobject FGift
	PutUser 1400500

	Transmit "n1Press any key...G1}"
	Exit
End

Exit

SYNTAX: ; ERROR: ; IOERR: ; er=rc' ('errortext(rc)') in line 'sigl
	getuser 1311992 ; a=result ; getuser 1311960 ; b=result ; c='"'a||b'"'
	er='Error Code 'er' of 'c ; transmit er ; logentry er ; bufferflush
Exit
