home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / bbs / birthday / birthday.scr next >
Text File  |  1992-02-15  |  8KB  |  272 lines

  1. Script
  2. abort off
  3. ;========================================================================
  4. ;= Birthday v1.0           -  Feb 15, 1992 -                  By Big D  =
  5. ;= Rubber City Atari BBS   - 300/1200/2400 -               216/376-0885 =
  6. ;=                                                                      =
  7. ;= Thanks to Outrider from the Rebel BBS                   702/435-0786 =
  8. ;= for his Audit program which I modified to make this program.         =
  9. ;=                                                                      =
  10. ;= And thanks to Chuck Grimsby for his Todays program ver 1.95.         =
  11. ;= The program, that gives this script a reason to be written.          =
  12. ;= It will write and/or use a birthday dat file that is compatable with =
  13. ;= Todays v1.95.. So as the evens for the day are displayed so will the =
  14. ;= birthdays of your BBS's users... Read the read me file...            =
  15. ;========================================================================
  16. ;  
  17. ;             =======   IMPORTANT INFO  PLEASE READ ========    
  18. ;   Because of the script commands Copy and Expand do not want to work
  19. ;   properly with out being compiled!!!!
  20. ;             =======  YOU MUST COMPILE THIS SCRIPT =======
  21. ;             =======       BEFORE YOU RUN IT       =======
  22. ;   Edit the User-Definable Variables below, save it then compile it.
  23. ;   before you run it.. Other wise it will screw the data file.......
  24.  
  25. ;~~~~~~~~~~~~~~~~~~~~~~~~ USER-DEFINABLE VARIABLES ~~~~~~~~~~~~~~~~~~~~~~
  26.  
  27. ;                 Change these to match your BBS
  28.  
  29. string BBS  = 'Rubber City Atari'       ; Name of your BBS
  30. string Log  = 'F:\RCACALL.LOG'          ; Your CALL LOG
  31. string Path = 'F:\BIRTHDAY\'            ; PATH for your Data files
  32.  
  33. integer Total_Users = '300'             ; Maximum your Userlog is set for
  34.  
  35. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OTHER VARIABLES ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36.  
  37. ;                        Please do not change
  38.  
  39. var Key
  40. var Line
  41. var Temp
  42. var Temp2
  43. var BirthDay
  44. var Birthday2
  45.  
  46. define Call = &27
  47. string Date = &24
  48. string Name = &1
  49. string Name2
  50.  
  51. integer Np
  52. integer Age
  53. integer Count
  54. integer Birth_Date
  55. integer Birth_Year
  56. integer Current_Day
  57. integer Current_Date
  58. integer Current_Year
  59. integer Current_Month
  60. integer Call_Num = &22
  61. integer User_Num = &31
  62. integer Screen_W = &11
  63.  
  64. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CHECK USER INFO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  65.  
  66. If file_exists '[Path]BirthDay.Dat'     ; Is this a first time run?
  67. else
  68.   gosub CREATE_DAT                      ; If so create dat file.
  69. endif
  70.  
  71. if command_level 1                      ; Skip VISITORS
  72. else
  73.   goto EXIT_WELCOME
  74. endif
  75.  
  76. Expand Name 30                          ; Set name to proper format
  77. Np = User_Num * 42                      ; Set file pointer Much faster
  78. Np = Np - 42                            ; then reading/writing whole file
  79.  
  80. if Call_Num = '1'                       ; Get info on their 1st call, if
  81.   goto GET_INFO                         ;   not a Visitor.
  82. endif
  83.  
  84. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ READ USER INFO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  85.  
  86. READ_INFO:
  87.  
  88. open '[Path]BirthDay.Dat' input         ; Get their Birthday.
  89.   point Np
  90.   finput BirthDay 
  91. close
  92.  
  93. if BirthDay = '*00000000 ------------------------------'; They haven't entered it yet.
  94.   goto GET_INFO
  95. endif
  96.  
  97. Name2 = copy (BirthDay, 11,30)
  98. expand name2 30
  99.  
  100. if Name # Name2           ; Is the name the same? If not correct it.
  101.   open Log append
  102.   fprinte '           ***Name did not match Birthday.dat name***'
  103.   fprinte '              User name : [Name]'
  104.   fprinte '           Dat file name: [Name2]'
  105.   close
  106.   goto Get_Info 
  107. Endif
  108.  
  109. Current_Year  = copy (Date, 7, 2)       ; Routine for parsering current
  110. Current_Month = copy (Date, 1, 2)       ;   date.
  111. Current_Day   = copy (Date, 4, 2)
  112. Current_Date  = '[Current_Month][Current_Day]'
  113.  
  114. Birth_Year    = copy (Birthday, 8, 2)   ; Routine for parsering user's
  115. Birth_Date    = copy (Birthday, 2, 2)   ; Date of birth.
  116. Temp          = copy (Birthday, 4, 2)
  117. Birthday2='[Birth_Date]/'
  118. Birthday2='[Birthday2][Temp]/'
  119. Birthday2='[Birthday2][Birth_Year]'
  120. Birth_Date    = '[Birth_Date][Temp]'
  121.  
  122. if Birth_Date > Current_Date            ; See if they've had their birthday
  123.   Birth_Year = Birth_Year + 1           ;   this year yet.
  124. endif
  125.  
  126. Age = Current_Year - Birth_Year         ; Get the caller's age.
  127.  
  128.  
  129. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAVE USER INFO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  130.  
  131. WRITE_INFO:
  132.  
  133. open Log append
  134.   fprinte '           Birth Date: [Birthday2]  Age: [Age] (&9)'
  135. close
  136.  
  137. goto CHECK_FOR_BIRTHDAY
  138.  
  139. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GET INFO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  140.  
  141. GET_INFO:
  142.  
  143. clear screen
  144. printe '\n\n'
  145. printe '\n'
  146. bell
  147. printe '\g***\r You are being audited by  \g***' center
  148. Printe '[BBS]\r' center
  149. bell
  150. Printe
  151. printe 'We need this information for our files!' center
  152. printe 'Please answer TRUTHFULLY.              ' center
  153. Printe 'You will later be asked to verify this ' center
  154. Printer'information, so it is imperative you   ' center
  155. Printe 'enter the correct information.         ' center
  156. printe '\n\n\b'
  157.  
  158. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GET BIRTHDAY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  159.   
  160. ENTER_BIRTHDAY:
  161.  
  162. Count    = '0'
  163. BirthDay = ''
  164.  
  165. print  'Please enter your real \rBIRTHDAY\b (\gMM\b/\gDD\b/\gYYYY\b):\r '
  166.  
  167. GET_BIRTHDAY:
  168.  
  169. get_key Key
  170.  
  171. if Key = numeric
  172.   print Key
  173. else
  174.   goto GET_BIRTHDAY                     ; If not numeric, ignore keypress.
  175. endif
  176.  
  177. if Count > 0                            ; We need to convert the first
  178.   goto GET_BIRTHDAY2                    ; digit from 0 to a space, if
  179. endif                                   ; necessary, to match format of
  180.                                         ; Express!.
  181. if Key = '0'
  182.   Key = ' '
  183. endif
  184.  
  185. GET_BIRTHDAY2:
  186.  
  187. BirthDay = '[BirthDay][Key]'            ; Add keypress to BirthDay string.
  188. increase Count
  189.  
  190. if Count = '2'
  191.   print '\g/\r'                         ; Date separator.
  192.  
  193. ef Count = '4'
  194.   print '\g/\r'
  195.  
  196. ef Count = '8'
  197.    goto EXIT_BIRTHDAY
  198. endif
  199.  
  200. goto GET_BIRTHDAY
  201.  
  202. EXIT_BIRTHDAY:
  203.  
  204. printe '\n'
  205. print  'Are you absolutely sure that is your correct birthday (y/N)?\b '
  206. get_key Key
  207.  
  208. if Key # 'Y'
  209.   printe 'No\n'
  210.   goto ENTER_BIRTHDAY
  211. endif
  212.  
  213. printe 'Yes\n\n'
  214.  
  215. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SAVE DATA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  216.  
  217. SAVE_DATA:
  218.  
  219. printe '\gPlease wait while I save your data'
  220.  
  221. Temp2 = 'I[Birthday] [Name]'
  222.  
  223. open '[Path]BirthDay.Dat' append
  224.   point Np
  225.   Fprinte Temp2
  226. close
  227.  
  228. goto READ_INFO
  229.  
  230. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CREATE DATA FILES ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  231.  
  232. CREATE_DAT:
  233.  
  234. Printe 'Creating Dat files, Please wait one '
  235.  
  236. open '[Path]BirthDay.Dat' output        ; Create initial BIRTHDAY.DAT.
  237.   for Key = 1 to Total_Users
  238.     fprinte '*00000000 ------------------------------'
  239.   endfor
  240. close
  241.  
  242. Printe 'Thank you for waiting'
  243.  
  244. return
  245.  
  246. ;~~~~~~~~~~~~~~~~~~~~~~~~ CHECK IF CALLER'S BIRTHDAY ~~~~~~~~~~~~~~~~~~~~~~
  247.  
  248. CHECK_FOR_BIRTHDAY:
  249.  
  250. if Birth_Date # Current_Date            ; Check if their birthday is today.
  251.   goto EXIT_WELCOME                     ; If not, we goto WELCOME.
  252. endif
  253.  
  254. clear screen
  255. bell
  256. view '[Path]Birthday.Txt'               ; Show them BIRTHDAY.TXT.
  257.  
  258. open Log append
  259.   fprinte '           *****  H A P P Y   B I R T H D A Y  *****'
  260.   close
  261. print 'Press <\rAny Key\b> To Continue\g...\b' center
  262. get_key Key
  263. printe '\n\n'
  264.  
  265. ;~~~~~~~~~~~~~~~~~~~~~~~~~~ END OF WELCOME.SCR HERE ~~~~~~~~~~~~~~~~~~~~~~~
  266.  
  267. EXIT_WELCOME:
  268.  
  269. exit                                    ; Or whatever else you want to add.
  270.  
  271.  
  272.