home *** CD-ROM | disk | FTP | other *** search
/ The Equalizer BBS / equalizer-bbs-collection_2004.zip / equalizer-bbs-collection / BBS-PCBOARD-STUFF / CRW-FK12.ZIP / FAKEFD.PAS < prev    next >
Pascal/Delphi Source File  |  1996-05-30  |  3KB  |  99 lines

  1. {$A+,B-,D+,E+,F-,G+,I+,L+,N-,O-,P-,Q-,R-,S+,T-,V+,X+,Y+}
  2. {$DEFINE DEBUG}
  3. Program FakeFD;
  4. Uses Crt, Dos, Tools, ComStuff;
  5.  
  6. Const Numbers : Array[1..25] Of String[17] = ('once', 'twice', 'three times', 'four times', 'five times',
  7.                                           'six times', 'seven times', 'eight times', 'nine times', 'ten times',
  8.                                           'eleven times', 'twelve times', 'thirteen', 'fourteen times',
  9.                                           'fifteen times', 'sixteen times', 'seventeen times', 'eighteen times',
  10.                                           'nineteen times', 'twenty times', 'twentyone times', 'twentytwo times',
  11.                                           'twentythree times', 'twentyfour times', 'twentyfive times');
  12.  
  13. Type Config = record
  14.    St1,
  15.    St2    : String[50];
  16.    NumEsc : Byte;
  17.    Delay  : Word;
  18. end;
  19.  
  20. Var
  21.   ProgPath : PathStr;
  22.   Setup    : Config;
  23.   Count    : Byte;
  24.   Ch       : Char;
  25.  
  26. Procedure ReadSetup;
  27. Var TxtFil : Text; S : String;
  28. begin
  29.    If Not FileExists(ProgPath + 'FAKEFD.CFG') Then MissingFile('FAKEFD.CFG');
  30.    Assign(TxtFil, ProgPath + 'FAKEFD.CFG');
  31.    Reset(TxtFil);
  32.    ReadLn(TxtFil, Setup.St1);
  33.    If Eof(TxtFil) Then
  34.    begin
  35.       CustomError := 'Error reading FAKEFD.CFG - too few lines!';
  36.       ErrorHandler(250);
  37.    end;
  38.    ReadLn(TxtFil, Setup.St2);
  39.    If Eof(TxtFil) Then
  40.    begin
  41.       CustomError := 'Error reading FAKEFD.CFG - too few lines!';
  42.       ErrorHandler(250);
  43.    end;
  44.    ReadLn(TxtFil, S);
  45.    If (StrToInt(S) > 25) Or (StrToInt(S) < 1) Then Setup.NumEsc := 2 Else Setup.NumEsc := StrToInt(S);
  46.    If Eof(TxtFil) Then
  47.    begin
  48.       CustomError := 'Error reading FAKEFD.CFG - too few lines!';
  49.       ErrorHandler(250);
  50.    end;
  51.    ReadLn(TxtFil, S);
  52.    If (StrToInt(S) > 25) Or (StrToInt(S) < 1) Then Setup.Delay := 2000 Else Setup.Delay := StrToInt(S) * 1000;
  53.    Close(TxtFil);
  54. end;
  55.  
  56. Procedure DisplayFile(Filename : String);
  57. var AnsiFile : Text;
  58. begin
  59.    Assign(AnsiFile, Filename);
  60.    Reset(AnsiFile);
  61.    Repeat
  62.       Read(AnsiFile, Ch);
  63.       ComWriteChar(Ch);
  64.    Until Eof(AnsiFile);
  65.    Close(AnsiFile);
  66. end;
  67.  
  68. Begin
  69.    ProgName := 'FakeFD';
  70.    ProgVersion := '1.23 ';
  71.    {$IFDEF DEBUG}
  72.    ProgPath := 'C:\BP\FAKEFD\';
  73.    {$ELSE}
  74.    ProgPath := GetProgramPath;
  75.    {$ENDIF}
  76.    Time_Credit := 5;
  77.    user_first_name := 'fAKEfD';
  78.    user_last_name := '1.23 bY fREEJACK oF  C R 0 W';
  79.  
  80.    ReadSetup;
  81.    Count := StrToInt(ParamStr(1));
  82.    If Count In [1..4] Then ComPort := Count Else ComPort := 0;
  83.    InitDoorDriver(False, True, 'fAKEfD 1.23 bY fREEJACK oF  C R 0 W', 200, False);
  84.  
  85.    Cls;
  86.    ComWriteLn('FakeFD 1.23.FW; Freeware; Crow Rules The BBS Scene!'#10#13);
  87.    ComWrite(Setup.St1 + ' ' + Numbers[Setup.NumEsc] + ' ' + Setup.St2);
  88.  
  89.    Count := 0;
  90.    Repeat
  91.       Ch := #0;
  92.       ComReadChar(Ch);
  93.       If Ch = #27 Then Inc(Count);
  94.    Until Count = Setup.NumEsc;
  95.  
  96.    If FileExists(ProgPath + 'BANNER.ASC') Then DisplayFile(ProgPath + 'BANNER.ASC');
  97.    Delay(Setup.Delay);
  98.  
  99. End.