(* Lucid BBS beta 30   Date  March 26, 1998                 *)
(* This Source has been released by the creator Judge Dredd *)
(* Do whatever you want with this source. If you do use any *)
(* thing from it, just give me some credit, if not oh well. *)

program Lucid;

{$M 64000,45000,45000}

Uses Barinfo,    (* Bottom Status Bar Info        *)
     Crt,        (* Pascal CRT Routines           *)
     Chat,       (* Split Screen Chats            *)
     Dataarea,   (* Data Areas                    *)
     Detector,   (* Detects OS,Mem ect            *)
     Dos,        (* Pascal MS-DOS Routines        *)
     filehandle, (* File Handling by Judge Dredd  *)
     filearea,   (* File Areas                    *)
     GenStr,     (* General Processing Functions  *)
     Init,       (* Software Initialization       *)
     IO,         (* Serial Input/Output Routines  *)
     msgarea,    (* Message Areas                 *)
     menu,       (* Menuing                       *)
     netmodem,   (* Reads in Netmodem/32 info     *)
     openfile,   (* Shows files still opened      *)
     ProtComm,   (* Low-Level Modem I/O Routines  *)
     Pullbar,    (* Pullbars                      *)
     Records,    (* All Record Structures         *)
     Swapit,     (* EMS Swap                      *)
     stackuse,   (* Stack Reporter                *)
     timeing,    (* Timer                         *)
     UserStuf,   (* User Routines                 *)
     wfc;        (* Wait For Caller               *)

begin
 NoSound;           { Relief! }
 loggedoff:=false;
 CurrentBar := 1;
 VGA_Setblink(False);
 swap:=true;
 Start_Init;
 localon:=false;
 fastClrScr;
 Displayadf('lucid.adf');
 infoit:=false;
 hungup:=false;
 if telnet=true then loadtcpip;
 repeat
 case wfcm of
              1 : Begin
                   if carrier=false then localon:=true;
                   hungup:=false;
                   infoit:=false;
                   fillchar(user,sizeof(user),#0);
                   Window(1,1,80,25);
                   user.time:=10;
                   user.timeperday:=10;
                   timeleft:=10;
                   logontime:=timer;
                   textmode(3);
                   CurrentBar := 1;
                   timeinit;
                   First_Menu;
                   timedeinit;
                   Textcolor(11);
                   asm mov ax,3; int 10h; end;
                   displayadf('LUCID.adf');
                   Window(26,17,73,21);
                   sendinit(COnfig.InitStr);
                   localon:=false;
                   loggedoff  :=false;
                   CurrentBar := 1;
                   hungup:=false;
                   hangup;
                  End;
              2 : Begin
                   Window(1,1,80,25);
                   hangup;
                   localon:=false;
                   DeInit;
                   asm mov ax,3; int 10h; end;
                   Halt(22);
                  End;
              3 : Begin
                   asm mov ax,3; int 10h; end;
                   Textcolor(7);
                   Window(1,1,80,25);
                   clrscr;
                   currentbar:=0;
                   write('Type EXIT to Return to LUCID');
                   Exec(GetEnv('COMSPEC'),'');
                   FastClrScr;
                   displayadf('LUCID.adf');
                   Window(26,17,73,21);
                   sendinit(Config.InitStr);
                  End;
              4 : Begin
                   sendinit(config.answerstr);
                   Localon := False;
                  End;
              5 : Begin HangUp; Localon := False; End;
              6 : sendinit(Config.InitStr);
              7 : Begin
                   Window(1,1,80,25);
                   asm mov ax,3; int 10h; end;
                   Textcolor(7);
                   Exec(GetEnv('COMSPEC'),'/C MENUEDIT.EXE');
                   FastClrScr;
                   displayadf('LUCID.ADF');
                   Window(26,17,73,21);
                   sendinit(Config.InitStr);
                  End;
              8 : Begin
                   Window(1,1,80,25);
                   asm mov ax,3; int 10h; end;
                   Textcolor(7);
                   Exec(GetEnv('COMSPEC'),'/C USEREDIT.EXE');
                   FastClrScr;
                   displayadf('LUCID.ADF');
                   Window(26,17,73,21);
                   sendinit(Config.InitStr);
                  End;
              12 : viewlogs;
        end;
     Window(1,1,80,25);
 until 1=2;
End.