home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RADOOR30.ZIP / FRAME.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-04-10  |  9.6 KB  |  221 lines

  1. {A+,B-,D-,E-,F-,I-,L-,N-,O-,R-,S+,V-}
  2. {$M 10000,0,0}
  3.  
  4. {╔═════════════════════════════════════════════════════════════════════════╗
  5.  ║                                                                         ║
  6.  ║                   (c) CopyRight LiveSystems 1990, 1994                  ║
  7.  ║                                                                         ║
  8.  ║ Author    : Gerhard Hoogterp                                            ║
  9.  ║ FidoNet   : 2:282/100.5   2:283/7.33                                    ║
  10.  ║ BitNet    : GERHARD@LOIPON.WLINK.NL                                     ║
  11.  ║                                                                         ║
  12.  ║ SnailMail : Kremersmaten 108                                            ║
  13.  ║             7511 LC Enschede                                            ║
  14.  ║             The Netherlands                                             ║
  15.  ║                                                                         ║
  16.  ║        This module is part of the RADoor BBS doorwriters toolbox.       ║
  17.  ║                                                                         ║
  18.  ╚═════════════════════════════════════════════════════════════════════════╝}
  19. {---------------------------------------------------------------------------|
  20.  
  21.  Description:
  22.  
  23.  Frame is a simple framework for a door written with the RADoor toolbox. It
  24.  has the main initializations already where they should, and the important
  25.  variables in place. Simply stuff some code at the spot marked X and compile.
  26.  that's all. Compiling this frame without anything further and the compiler
  27.  toggles as above resulted in an EXE file with the following values in the
  28.  Get Info window of TP5.5:
  29.  
  30.     CodeSize   32560 bytes
  31.     DataSize   28812 bytes
  32.  
  33.  Not too much for an all singing, all dancing door featuring everything a door
  34.  should feature, supporting 3 BBSses almost transparant to the sysop and
  35.  programmer..
  36.  
  37. - 2 Feb 92: Release
  38.  
  39. }
  40.  
  41.  
  42. Program FRAME;
  43. Uses
  44.      Fossil,     { The fossil routines + Timing. This is the     }
  45.                  {  body of the door!                            }
  46.      UserHook,   { Demo/default userhook procedures              }
  47.      Filter,     { The default output filter                     }
  48.      GlobInfo,   { the global record with all the nessecary info }
  49.      RA,         { The RA init code                              }
  50.      SuperBBS,   { The SBBS init Code                            }
  51.      QuickBBS,   { The QBBS init code                            }
  52.      LowLevel,   { The lowlevel stuff                            }
  53.      DoorSys,    { Misc. Door routines.                          }
  54.      BBSTypes,   { Autodetect BBS Type. Default RA               }
  55.      CRT,        { TP CRT unit                                   }
  56.      DOS;        { TP DOS unit                                   }
  57.  
  58. {----------------------------------------------------------------------------|
  59.   The name and the version of the program together with the FossilObject
  60.   variable which every door needs.
  61. |----------------------------------------------------------------------------}
  62.  
  63.  
  64. Const  ProgramName    = 'FRAME';
  65.        ProgramVersion = '2.0';
  66.        LastUpdate     = '12 Feb 1992';
  67.  
  68. Var Foss       : FossilObject;
  69.  
  70.  
  71. {----------------------------------------------------------------------------|
  72.  Start here your own variables, procedures and functions.
  73. |----------------------------------------------------------------------------}
  74.  
  75.  
  76.  
  77.  
  78. {----------------------------------------------------------------------------|
  79.  Start of main module
  80. |----------------------------------------------------------------------------}
  81. Begin
  82. ClrScr;
  83. WriteLn(ProgramName,' ',ProgramVersion,' (c) LiveSystems 1990,1991   ALL RIGHTS RESERVED,  NO GUARANTEES');
  84. WriteLn('Written by G.Hoogterp. E-mail address 2:283/1.2 Last Revision '+LastUpdate);
  85. WriteLn('Use <FileName> -? to see commandline parameter summary.');
  86.  
  87. If ExistParameter('?')
  88.    Then Begin
  89.         WriteLn('Usage: ');
  90.         WriteLn;
  91.         WriteLn(' <FileName.EXE [-T:<TimeLimit>] [-N:*N] [-P:*P] [-NOS]');
  92.         WriteLn;
  93.         WriteLn(' -T:     Limit the time available in the door.');
  94.         WriteLn(' -N:     Give nodenumber for multiline setups.');
  95.         WriteLn(' -P:     Give ComPort to use.');
  96.         WriteLn(' -NOS    Turn local sounds OFF for default.');
  97.         Halt;
  98.         End;
  99.  
  100. { The parameters mentioned here are read in the RA.PAS unit as they are more
  101.   or less RA dependend and the result has to be stuffed into the global info
  102.   record. }
  103.  
  104. {----------------------------------------------------------------------------|
  105.  Grab the BBS specific stuff into the GlobalInfo record
  106. |----------------------------------------------------------------------------}
  107.  
  108. Case CurrentBBStype Of
  109.  RA_BBS : InitRA;
  110.  S_BBS  : InitSBBS;
  111.  Q_BBS  : InitQBBS;
  112. End;
  113.  
  114. {----------------------------------------------------------------------------|
  115.  And let the LOGfile know who's talking.
  116. |----------------------------------------------------------------------------}
  117.  
  118. LogIt('Started: '+ProgramName+' '+ProgramVersion+' under '+GlobalInfo.BBSName);
  119.  
  120. {----------------------------------------------------------------------------|
  121.   Initialize the userhooks, Timeout detection etc.
  122. |----------------------------------------------------------------------------}
  123.  
  124. With GlobalInfo Do
  125.  Begin
  126.  Foss.AssignF(ComPort-1,BaudRate);   { Inti the fossil }
  127.  If Foss.Error<>0
  128.     Then Begin
  129.          WriteLn(#254' Couldn''t initialize fossil!');
  130.          LogIt('Couldn''t init fossil!');
  131.          Halt;
  132.          End;
  133.  
  134.  Foss.InitTimer(                         { Init the timeout procedures              }
  135.                 GlobalInfo.Warnings,     { Warning before pushed back to the BBS    }
  136.                 GlobalInfo.TimeOutTime   { Timeout time before and between warnings }
  137.                 );
  138.  
  139.  
  140.  Foss.InitOutputFilter(UsedFilter); { Set the output filter            }
  141.  Foss.InitInputFilter(AllCharSet);  { Set the input filter for ReadLnF }
  142.  
  143. {------ SysOp Keys and StatusLine procedures are in the USERHOOK.TPU ---------}
  144.  
  145.  Foss.InitSysopKeys(SysopKeys);     { Set the SYSOP keys procedure            }
  146.  Foss.InitStatLine(StatusLine);     { Set the statusline procedure            }
  147.  
  148. {---- Initialize the output filter using the info in the GlobalInfo record ---}
  149.  
  150.  InitUsedFilter(UseGraphics,UseAVATAR,LeftBracket,RightBracket,'^');
  151.  End;
  152.  
  153.  
  154. {--- Initialize the colortable, These are the colors used in my programs -----}
  155.  
  156. ColorTable[0]:=LightCyan;           { Normal text color                       }
  157. ColorTable[1]:=LightRed;            { Hotkey's and lines                      }
  158. ColorTable[2]:=White;               { Userinput and info highlight            }
  159. ColorTable[3]:=Yellow;              { Info                                    }
  160. ColorTable[4]:=(Blue Shl 4)+White;  { Statusline color                        }
  161. ColorTable[5]:=LightRed;            { Lines and frames                        }
  162. ColorTable[6]:=(Red shl 4)+White;   { User input fields                       }
  163.  
  164. {---------- Initialise the strings in the FOSSIL.PAS unit --------------------}
  165.  
  166. PressEnterOrStopString := '^0Press ^[^1ENTER^0^] to continue, ^[^1S^0^] to Stop: ^2';
  167. PressEnterString       := '^0Press ^[^1ENTER^0^] to continue: ^2';
  168. Warning1String         := '^1^[^2 You have only 2 minutes left!^1^]^2';
  169. Warning2String         := '^1^[^2 You have only 1 minute left! ^1^]^2';
  170. AttentionString        := '^2HELLO???';
  171. LockOutString          := '^1--- You''ve been locked out of the system! Don''t call back..';
  172. HangUpString           := '^1--- The Sysop hungup the phone, call back an other time.';
  173. TimeUpString           := '^1Sorry, you reached your daily timelimit. Hope to see you back an other time.';
  174. UsedStopKey            := 'S';
  175.  
  176.  
  177. {----------------------------------------------------------------------------|
  178.   The mainbody of the DOOR goes here.
  179. |----------------------------------------------------------------------------}
  180.  
  181.  
  182.                                    { Mark -> X }
  183.  
  184.  
  185. {----------------------------------------------------------------------------|
  186.   Finalize the DOOR and say a nice thank you to the user for spending his
  187.   online time and money on your door..
  188. |----------------------------------------------------------------------------}
  189.  
  190. Case CurrentBBSType Of
  191.  RA_BBS : If Not RAUpdateExitInfo
  192.              Then LogIt('Couldn''t update the EXITINFO.BBS!');
  193.  S_BBS  : If Not SBBSUpdateExitInfo
  194.              Then LogIt('Couldn''t update the EXITINFO.BBS!');
  195.  Q_BBS  : If Not QBBSUpdateExitInfo
  196.              Then LogIt('Couldn''t update the EXITINFO.BBS!');
  197. End;
  198.  
  199. Foss.ClrScrF;  { Clear the screen }
  200. Foss.WriteLnF('Thanks for using '+ProgramName+'.');
  201.  
  202. {----------------------------------------------------------------------------|
  203.   Tell the LogFile that we're finished. Gives the fossil some extra time
  204.   to get the ThankYou out of it's mouth....
  205. |----------------------------------------------------------------------------}
  206.  
  207. LogIt('Stopped: '+ProgramName+' '+ProgramVersion);
  208.  
  209. {----------------------------------------------------------------------------|
  210.  And close the fossil again..
  211. |----------------------------------------------------------------------------}
  212.  
  213. Foss.CloseF;
  214. End.
  215.  
  216. {----------------------------------------------------------------------------|
  217.    And that's it! That's all.. I can't make things simpler..
  218.    Oh well, actualy I could, but not without giving up flexability and
  219.    usability.....
  220. |----------------------------------------------------------------------------}
  221.