home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / lw32text.zip / host.cmd < prev    next >
OS/2 REXX Batch file  |  1996-02-15  |  19KB  |  708 lines

  1. /* LiveWire/WPS Host Mode */
  2.  
  3. /**
  4.  **
  5.  ** LiveWire 3.1 Host Mode
  6.  ** REXX procedures language version
  7.  **
  8.  ** You may modify this script file to meed your needs
  9.  **
  10.  **/
  11.  
  12. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  13. call SysLoadFuncs
  14.  
  15. /* Return to this point if carrier lost */
  16. LostCarrier:
  17. bCarrier = HangupLW();
  18. SetLW(TimeOut,60);
  19.  
  20. /*Trace I;*/         /* Uncomment for debug tracing */
  21.  
  22. /** Current User Information **/
  23. Name=""
  24. Password=""
  25. Address1=""
  26. Address2=""
  27. PhoneNumber=""
  28.  
  29. /** Host Mode Configuration Information **/
  30. MessageDir=".\HSTMSGS"
  31. FileDir=".\HSTFILES"
  32. SysopPassword="PASSWORD"
  33. SecureSystem="N";
  34. MaxTime=60
  35. LockPort=GetLW(LockedPort);
  36. OldSpeed=GetLW(Speed);
  37.  
  38.  
  39. /** Global Variables **/
  40. LogonName=""
  41. LogonPassword=""
  42.  
  43.    /* Check for LOCAL flag */
  44.    if (Translate(Arg(1))=='LOCAL') then
  45.       SetLW(LocalOnly, On);
  46.    else
  47.       SetLW(LocalOnly,Off);
  48.  
  49.    /* Main Host Loop */
  50.    do forever
  51.        LogLW("Host Mode Initiated");
  52.        SetLW(FGColor,15);
  53.        SetLW(BGColor,1);
  54.        ClrScrLW();
  55.        SetLW(Speed,OldSpeed);
  56.        bCarrier = HangUpLW();
  57.        SendLW("AT^M");
  58.  
  59.        DispLW("┌───────────────────────┐^M^J");
  60.        DispLW("┘ LiveWire/WPS 3.1 Host └^M^J");
  61.        DispLW("  ─────────────────────  ^M^J");
  62.        DispLW("^M^J");
  63.        DispLW("  To stop this host type STOP or press the STOP in the REXX Control Panel^M^J");
  64.        DispLW("  To logon to this host locally, type LOCAL^M^J");
  65.        SendLW("ATZ^M");
  66.        SleepLW(1);
  67.        SendLW("ATE1X4S0=0^M");
  68.        SleepLW(1);    
  69.  
  70.        if (stream("HOST.CFG",C,"query exists")="") then
  71.            MakeConfig();
  72.    
  73.        if (stream("HOST.USR",C,"query exists")="") then
  74.            MakeUserList();
  75.  
  76.        ReadConfigFile();
  77.  
  78.        /* Display message indicating this is a secure system */
  79.        if (SecureSystem == "Y") then do
  80.            DispLW("^M^J");    
  81.            DispLW("  THIS HOST IS IN SECURE MODE, ALL INCOMING CALLS REQUIRE SYSOP PASSWORD^M^J");
  82.            DispLW("   (the default sysop password is 'PASSWORD')^M^J");
  83.        end        
  84.  
  85.        DispLW("^M^J");
  86.   
  87.        x = SysMkDir(MessageDir);
  88.        x = SysMkDir(FileDir);
  89.  
  90.        if (GetLW(LocalOnly)) then
  91.          Logon();
  92.        else do
  93.           DispLW(" Now waiting for a call...^M^J");
  94.           LogLW("Awaiting a caller");
  95.           WaitForRing();
  96.  
  97.           /* Logon directly if this is a local call */ 
  98.           if (GetLW(LocalOnly)) then
  99.       do    
  100.                Logon();
  101.  
  102.                /* Go back to taking normal calls */
  103.                SetLW(LocalOnly, Off);
  104.           end
  105.           else
  106.           do
  107.            if (DoConnect()) then do      
  108.                     if (SecureSystem == "Y") then
  109.                     Logon();
  110.              else
  111.             SecureLogon();                   
  112.                end;
  113.           end
  114.        end
  115.     end
  116. exit
  117.  
  118. WaitForRing:
  119.      OldTimeOut=GetLW(TimeOut);
  120.      SetLW(TimeOut,0);
  121.      x=FindLW("RING", "LOCAL", "STOP");
  122.  
  123.      if (x = "LOCAL") then
  124.        SetLW(LocalOnly, On);
  125.  
  126.      if (x = "STOP") then
  127.         StopHost();  
  128.  
  129.      SetLW(TimeOut,OldTimeOut);
  130.      return "";
  131.  
  132. DoConnect:
  133.    /* Send ATA to answer modem */
  134.    SendLW("ATA^M");
  135.  
  136.    /* First, see if we have a locked port */
  137.    if LockPort then
  138.    do
  139.       /* LOCKED PORT, DO NOT CHANGE BPS RATE ON CONNECT */
  140.  
  141.       q=FindLW("CONNECT", "NO CARRIER");
  142.       if (q=="CONNECT") then
  143.          return 1;
  144.       else
  145.          return 0;
  146.    end
  147.    else
  148.    do
  149.       /* Non-Locked port, attempt to parse bps rate */
  150.       q=FindLW("CONNECT^M", "CONNECT 1200", "CONNECT 2400",
  151.                   ,"CONNECT 4800", "CONNECT 9600", "CONNECT 19200",
  152.                   ,"CONNECT 38400", "CONNECT 14400", "NO CARRIER");
  153.  
  154.       if (q="CONNECT"||D2C(13)) then
  155.          SetLW(Speed, 300);
  156.       else
  157.       if (q="CONNECT 1200") then
  158.          SetLW(Speed, 1200);
  159.       else
  160.       if (q="CONNECT 2400") then
  161.          SetLW(Speed, 2400);
  162.       else
  163.       if (q="CONNECT 4800") then
  164.          SetLW(Speed, 4800);
  165.       else
  166.       if (q="CONNECT 9600") then
  167.          SetLW(Speed, 19200);
  168.       else
  169.       if (q="CONNECT 38400") then
  170.          SetLW(Speed, 38400);
  171.       else
  172.       if (q="CONNECT 14400") then
  173.          SetLW(Speed, 14400);
  174.       else
  175.          return 0;
  176.  
  177.       return 1;
  178.    end
  179.  
  180. SecureLogon:
  181.    /* First, make sure modem is clear before logon */
  182.    DelayLW(500);
  183.    FlushBufferLW();
  184.  
  185.    SetLW(EchoBack,On);
  186.    DiseFile("SECURE");
  187.  
  188.    LogonPassord="";
  189.  
  190.    /* Get secure password */
  191.    DiseLW("^M^JSecure Password > ");
  192.    LogonPassword = Translate(HostReadString("",40));
  193.  
  194.    /* If password does not match, hangup immediately */
  195.    if (LogonPassword \= SysopPassword) then
  196.       Signal LostCarrier;
  197.  
  198.    return MainMenu();  
  199.  
  200. Logon:
  201.    /* First, make sure modem is clear before logon */
  202.    DelayLW(500);
  203.    FlushBufferLW();
  204.  
  205.    SetLW(EchoBack,On);
  206.    DiseFile("WELCOME");
  207.  
  208.    LogonName="";
  209.  
  210.    /* Get users' name */
  211.    Done=0;
  212.    do until (Done)
  213.       DiseLW("^M^JEnter your full name > ");
  214.       LogonName=Translate(HostReadString("",40));
  215.       if (LogonName = "") then Done=0;
  216.           else Done=1;
  217.    end /* do */
  218.  
  219.    /* Get user record from host user file */
  220.    q=stream("HOST.USR",C,"open");
  221.    Done=0;
  222.    Name="";
  223.    do until (Name=LogonName | Lines("HOST.USR")=0)
  224.       Name=LineIn("HOST.USR");
  225.       Password=LineIn("HOST.USR");
  226.       Address1=LineIn("HOST.USR");
  227.       Address2=LineIn("HOST.USR");
  228.       PhoneNumber=LineIn("HOST.USR");
  229.    end /* do */
  230.  
  231.    if (Name=LogonName) then do
  232.  
  233.       LogLW("User Called " Name);
  234.       LogonPassword="";
  235.  
  236.       /* Verify caller's password */
  237.       do until (LogonPassword=Password)
  238.          DiseLW("^M^JEnter your password >");
  239.          SetLW(EchoBack, 0);
  240.          LogonPassword=Translate(HostReadString("", 40));
  241.          SetLW(EchoBack, 1);
  242.       end /* do */
  243.    end  /* Do */
  244.     else
  245.    do
  246.         /* If we could not find username, this must be a new user! */
  247.  
  248.         LogLW("New User Validated");
  249.         Name=LogonName;
  250.         DiseFile("NEWUSER");
  251.         PhoneNumber="";
  252.         Address1="";
  253.         Address2="";
  254.         DiseLW("^M^JPlease fill out the following information for our records^M^J");
  255.         DiseLW("Phone Number      : ");
  256.         PhoneNumber=HostReadString("",40);
  257.         DiseLW("^M^JStreet Address    : ");
  258.         Address1=HostReadString("",70);
  259.         DiseLW("^M^JCity, State & ZIP : ");
  260.         Address2=HostReadString("",70);
  261.         DiseLW("^M^J^M^JYou must now enter a password for your account on this system.^M^J");
  262.         DiseLW("If you do not wish to have a password, just press ENTER.^M^J");
  263.  
  264.         Retry="1";
  265.         Password="2";
  266.         do until (Retry=Password)
  267.             DiseLW("^M^JPassword        : ");
  268.             Password=Translate(HostReadString("",30));
  269.             DiseLW("^M^JRe-enter your password for verification : ");
  270.             Retry=Translate(HostReadString("",30));
  271.         end /* do */
  272.  
  273.         DiseLW("^M^J^M^JThank you...");
  274.  
  275.         /* Write new user information to disk */
  276.         q=LineOut("HOST.USR",Name);
  277.         q=LineOut("HOST.USR",Password);
  278.         q=LineOut("HOST.USR",Address1);
  279.         q=LineOut("HOST.USR",Address2);
  280.         q=LineOut("HOST.USR",PhoneNumber);
  281.    end /* Do */
  282.  
  283.    /* Close user file */
  284.    q=stream("HOST.USR","c","close");
  285.  
  286.    MainMenu:
  287.    DoHangup=0;
  288.    do until (DoHangup)
  289.       Option=""
  290.       DiseFile("MAINMENU");
  291.       DiseLW("Select a function: ");
  292.       Option=Translate(HostReadChar());
  293.       DiseLW("^M^J");
  294.       if Option="H" then DoHangup=1;
  295.       if Option="F" then ShowFiles();
  296.       if Option="U" then UploadFile();
  297.       if Option="D" then DownloadFile();
  298.       if Option="P" then PageSysop();
  299.       if Option="R" then ReadMessages();
  300.       if Option="S" then SendMessage();
  301.       if Option="O" then OperatorFuncs();
  302.    end;
  303.  
  304.    EndLogon:
  305.    LogLW("User Hung Up Normally");
  306.    DiseLW("^M^J^M^JThank you for calling... (click)^M^J^M^J");
  307.    SetLW(EchoBack,Off);
  308.    DelayLW(250);
  309.    bCarrier = HangUpLW();
  310.    SleepLW(1);
  311.    FlushBufferLW();
  312.    return "";
  313.  
  314. OperatorFuncs:
  315.    OpPswd=""
  316.    OpOption=""
  317.  
  318.    DiseLW("^M^J^M^JEnter system operator password: ");
  319.    SetLW(EchoBack,Off);
  320.    OpPswd=Translate(HostReadString("",40));
  321.    SetLW(EchoBack,On);
  322.    if OpPswd=SysopPassword then do
  323.       LogLW("User Entered Sysop Operations");
  324.       QuitSysop=0;
  325.       do until (QuitSysop)
  326.            DiseLW(" ^M^J^M^JSystem Operator Functions^M^J^M^J");
  327.            DiseLW("^M^J  1. Change Message Directory : " MessageDir);
  328.            DiseLW("^M^J  2. Change File Directory    : " FileDir);
  329.            DiseLW("^M^J  3. Locked Baud Rate (0=No)  : " LockPort);
  330.            DiseLW("^M^J  4. Change Sysop Password    : " SysopPassword);
  331.        DiseLW("^M^J  5. Secure system            : " SecureSystem);    
  332.        DiseLW("^M^J     (Access by sysop password only)");
  333.  
  334.            DiseLW("^M^J^M^J  S  Save these options");
  335.            DiseLW("^M^J  Q  Quit without saving^M^J^M^J");
  336.            DiseLW("Select option: ");
  337.            OpOption=Translate(HostReadChar());
  338.            DiseLW("^M^J");
  339.  
  340.            if OpOption="1" then OpGetMsgDir();
  341.            if OpOption="2" then OpGetFileDir();
  342.            if OpOption="3" then OpGetLockPort();
  343.            if OpOption="4" then OpGetPassword();
  344.        if OpOption="5" then OpGetSecurity();
  345.            if OpOption="S" then OpSaveConfig();
  346.            if OpOption="Q" then OPQuitConfig();
  347.       end
  348.    end
  349.    return "";
  350.  
  351.    OpGetMsgDir:
  352.    DiseLW("Edit message directory (DO NOT END WITH A BACKSLASH)^M^J");
  353.    DiseLW("> ");
  354.    MessageDir=HostReadString(MessageDir,70);
  355.    return "";
  356.  
  357.    OpGetFileDir:
  358.    DiseLW("Edit files directory (DO NOT END WITH A BACKSLASH)^M^J");
  359.    DiseLW("> ");
  360.    FileDir=HostReadString(FileDir,70);
  361.    return "";
  362.  
  363.    OpGetLockPort:
  364.    DiseLW("Edit locked baud rate (1=on 0=off)^M^J");
  365.    DiseLW("> ");
  366.    LockPort=GetLW(LockedPort);
  367.    LockPort=HostReadString(LockPort,3);
  368.    SetLW(LockedPort, LockPort);
  369.    return "";
  370.  
  371.    OpGetPassword:
  372.    DiseLW("Edit sysop password^M^J");
  373.    DiseLW("> ");
  374.    SysopPassword=Translate(HostReadString(SysopPassword,70));
  375.    return "";
  376.  
  377.    OpGetSecurity:
  378.    DiseLW("Do you require a secure system? (Y/N)^M^J");
  379.    DiseLW("> ");
  380.    SecureSystem = Translate(HostReadChar());
  381.    return "";       
  382.  
  383.    OpSaveConfig:
  384.    DiseLW("Saving...");
  385.    MakeConfig();
  386.    DiseLW("^M^J^M^J");
  387.    QuitSysop=1;
  388.    return "";
  389.  
  390.    OpQuitConfig:
  391.    ReadConfigFile();
  392.    DiseLW("^M^J^M^J");
  393.    QuitSysop=1;
  394.    return "";
  395.  
  396. SendMessage:
  397.    MaxMessage=0
  398.    ThisMessage=0
  399.    MsgFileName=""
  400.    MsgLine=""
  401.    MsgOption=""
  402.  
  403.    LogLW("User began a message");
  404.  
  405.    if (stream(MessageDir||"\HOST.MSG",C,"query exists")\="") then do
  406.       q=stream(MessageDir||"\HOST.MSG",C,"open");
  407.       MaxMessage=LineIn(MessageDir||"\HOST.MSG");
  408.       q=stream(MessageDir||"\HOST.MSG",C,"close");
  409.    end  /* Do */
  410.  
  411.    MaxMessage=MaxMessage + 1;
  412.    ThisMessage=MaxMessage;
  413.  
  414.    MsgFileName=MessageDir||"\MESSAGE."||ThisMessage;
  415.    q=stream(MsgFileName, C, "open");
  416.    DiseLW("^M^J^M^JEnter your message");
  417.    DiseLW("^M^JEnd your message by placing a period (.) alone on the last line^M^J");
  418.    DiseLW("----------------------------------------------------------------------------^M^J");
  419.    q=LineOut(MsgFileName, " ------------------------------");
  420.    q=LineOut(MsgFileName, " Message #"||ThisMessage);
  421.    q=LineOut(MsgFileName, " From    :"||Name);
  422.    q=LineOut(MsgFileName, "------------------------------");
  423.    q=LineOut(MsgFileName, "^M^J");
  424.  
  425.    FinishedMessage=0;
  426.    LineNo=1;
  427.    do until(FinishedMessage)
  428.       DiseLW(LineNo||"> ");
  429.       MsgLine=HostReadString("",75);
  430.       DiseLW("^M^J");
  431.       if (MsgLine=".") then FinishedMessage=1;
  432.       q=LineOut(MsgFileName, MsgLine);
  433.       LineNo=LineNo+1;
  434.    end
  435.  
  436.    FinishedMessage=0;
  437.    do until (FinishedMessage)
  438.         DiseLW("^M^JMessage Ended^M^J");
  439.         DiseLW("[S]ave Message  [A]bort Message : ");
  440.         MsgOption=Translate(HostReadChar());
  441.         DiseLW("^M^J");
  442.         if MsgOption="S" then SaveMessage();
  443.         if MsgOption="A" then AbortMessage();
  444.    end /* do */
  445.  
  446.    return "";
  447.  
  448.    SaveMessage:
  449.         FinishedMessage=1;
  450.         q=LineOut(MsgFileName,"------------------------------");
  451.         q=stream(MsgFileName,C,"close");
  452.         "erase "||MessageDir||"\HOST.MSG"
  453.         q=stream(MessageDir||"\HOST.MSG",C,"open write");
  454.         q=LineOut(MessageDir||"\HOST.MSG", ThisMessage);
  455.         q=stream(MessageDir||"\HOST.MSG",C,"close");
  456.         return "";
  457.         Goto RetSendMessage
  458.  
  459.     AbortMessage:
  460.         FinishedMessage=1;
  461.         "erase "||MsgFileName
  462.         return "";
  463.  
  464. ReadMessages:
  465.    MaxMessage=1
  466.    ThisMessage=1
  467.    MsgFileName=""
  468.    MsgOption=""
  469.  
  470.    LogLW("User Read Messages");
  471.    if (stream(MessageDir||"\HOST.MSG",C,"query exists")="") then do
  472.       DiseLW("^M^JSorry, there are no messages.^M^J");
  473.       SleepLW(2);
  474.       return "";
  475.    end  /* Do */
  476.  
  477.    q=stream(MessageDir||"\HOST.MSG",C,"open read");
  478.    MaxMessage=LineIn(MessageDir||"\HOST.MSG");
  479.    q=stream(MessageDIR||"\HOST.MSG",C,"close");
  480.  
  481.    DiseLW("^M^JMessages range from 1 to "||MaxMessage||"^M^J");
  482.    DiseLW("Enter message to start reading at : ");
  483.    ThisMessage=HostReadString(ThisMessage,3);
  484.    DiseLW("^M^J");
  485.  
  486.    DoneReading=0;
  487.    do until (DoneReading)
  488.         MsgFileName=MessageDir||"\MESSAGE."||ThisMessage
  489.         if (stream(MsgFileName,C,"query exists")\="") then do
  490.            DiseFile(MsgFileName);
  491.            DiseLW("^M^J[ENTER] for next message or [Q] to quit : ");
  492.            MsgOption=HostReadChar();
  493.            DiseLW("^M^J");
  494.            if MsgOption="Q" then DoneReading=1;
  495.         end  /* Do */
  496.  
  497.         ThisMessage=ThisMessage+1;
  498.         if (ThisMessage>MaxMessage) then DoneReading=1;
  499.     end;
  500.  
  501.     DiseLW("^M^JEnd of messages.^M^J");
  502.     SleepLW(2);
  503.     return "";
  504.  
  505. PageSysop:
  506.     LogLW("User Attempted To Page Sysop");
  507.     DiseLW("^M^JPaging operator, press Q to abort...^M^J");
  508.     DispLW("SYSOP: Press 'C' to chat^M^J");
  509.  
  510.     StopPage=0;
  511.     OldTimeOut=GetLW(TimeOut);
  512.     SetLW(TimeOut,2);
  513.  
  514.     do until (StopPage)
  515.     Beep(1062, 50);
  516.     Beep(1062, 50);
  517.     Beep(1062, 50);
  518.         
  519.         Key=Translate(GetKeyLW());
  520.  
  521.         if Key="Q" then do
  522.             SetLW(TimeOut,OldTimeOut);
  523.             return "";
  524.         end  /* Do */
  525.  
  526.         if Key="C" then StopPage=1;
  527.     
  528.     /* Check for carrier loss */
  529.     if ((GetLW(Online)==0) & (\GetLW(LocalOnly))) then
  530.           Signal LostCarrier;
  531.     end
  532.  
  533.     SetLW(TimeOut,0);
  534.  
  535.     DiseLW("^M^J^M^J You are now in chat mode^M^J");
  536.     DispLW(" SYSOP: Type ~ (tilde character) on a blank line to end chat mode");
  537.     DispLW("^M^J^M^J");
  538.     LogLW("Sysop Answered Chat Request");
  539.  
  540.     Key=""
  541.     do until Key="~"
  542.         Key=""
  543.         DiseLW(" ");
  544.         Key=HostReadString("",77);
  545.         DiseLW("^M^J");
  546.     end
  547.  
  548.  
  549.     SetLW(TimeOut,OldTimeOut);
  550.     return "";
  551.  
  552. UploadFile:
  553.     ULProtocol=""
  554.     ULFile=""
  555.     ULFile2=""
  556.  
  557.     DiseFile("PROT");
  558.  
  559.     DiseLW("Select protocol: ");
  560.     ULProtocol=Translate(HostReadChar());
  561.  
  562.     /* Check if this is a batch upload... */
  563.     BatchUpload=0;
  564.     if ULProtocol="Y" then BatchUpload=1;
  565.     if ULProtocol="Z" then BatchUpload=1;
  566.  
  567.    /* Set download directory if this a a batch upload */
  568.     if (BatchUpload) then do
  569.        OldDLDir=GetLW(DLDir);
  570.        SetLW(DLDir, FileDir);
  571.     end
  572.       else
  573.     do
  574.         DiseLW("^M^J^M^JName of file you are uploading: ");
  575.         ULFile=HostReadString(ULFile,77);
  576.         if ULFile="" then return "";
  577.         ULFile2=FileDir||"\"||ULFile;
  578.     end
  579.  
  580.     DiseLW("^M^JStart your upload now...^M^J");
  581.  
  582.     if (BatchUpload) then
  583.         ret = ReceiveFilesLW(ULProtocol, "");
  584.     else
  585.         ret = ReceiveFilesLW(ULProtocol,ULFile2);
  586.  
  587.    /* Restore old download directory */
  588.     if (BatchUpload) then
  589.          SetLW(DLDir, OldDLDir);
  590.  
  591.     SleepLW(1);
  592.     FlushBufferLW();
  593.  
  594.     return "";
  595.  
  596. DownloadFile:
  597.    DLProtocol=""
  598.    DLFile=""
  599.    DLFile2=""
  600.  
  601.    DiseFile("PROT");
  602.    DiseLW("Select protocol: ");
  603.    DLProtocol=HostReadChar();
  604.    DiseLW("^M^JName of file you are downloading: ");
  605.    DLFile=HostReadString("",77);
  606.    if DLFile\="" then do
  607.       DiseLW("^M^J");
  608.       DLFile2=FileDir||"\"||DLFile;
  609.       if (stream(DLFile2,C,"query exists")="") then do
  610.          DiseLW("^M^J^M^JThat file does not exist!^M^J");
  611.          SleepLW(2);
  612.       end  /* Do */
  613.        else
  614.       do
  615.          DiseLW("Start download now...^M^J");
  616.          ret = SendFilesLW(DLProtocol,DLFile2);
  617.          SleepLW(1);
  618.          FlushBufferLW();
  619.          LogLW("User downloaded file "||DLFile2);
  620.       end
  621.    end
  622.    return "";
  623.  
  624. ShowFiles:
  625.   "DIR "||FileDir||" >host.out"
  626.   DiseLW("^M^J^M^J");
  627.   DiseFile("HOST.OUT");
  628.   DiseLW("^M^JPress [ENTER]");
  629.   q=HostReadChar();
  630.   return "";
  631.  
  632. DiseFile:
  633. arg DispFile
  634.  
  635.     q=stream(DispFile,C,"open read");
  636.  
  637.     do until lines(DispFile) = 0
  638.          DiseLW(linein(DispFile));
  639.          DiseLW("^M^J");
  640.     end /* do */
  641.  
  642.     q=stream(DispFile,C,"close");
  643.     return "";
  644.  
  645. ReadConfigFile:
  646.     LogLW("Read Configuration File");
  647. /*    DispLW(" Reading configuration file...");*/
  648.     q=stream("HOST.CFG",C,"open read");
  649.     MessageDir=LineIn("HOST.CFG");
  650.     FileDir=LineIn("HOST.CFG");
  651.     SysopPassword=LineIn("HOST.CFG");
  652.     MaxTime=LineIn("HOST.CFG");
  653.     LockPort=LineIn("HOST.CFG");
  654.     SecureSystem=LineIn("HOST.CFG");
  655.     q=stream("HOST.CFG",C,"close");
  656. /*    DispLW("OK^M^J");*/
  657.     return "";
  658.  
  659. MakeConfig:
  660.     LogLW("Created Configuration File");
  661.     DispLW(" Creating configuration file...");
  662.     q=SysFileDelete("HOST.CFG");
  663.     q=stream("HOST.CFG",C,"open write");
  664.     q=LineOut("HOST.CFG", MessageDir);
  665.     q=LineOut("HOST.CFG", FileDir);
  666.     q=LineOut("HOST.CFG", SysopPassword);
  667.     q=LineOut("HOST.CFG", MaxTime);
  668.     q=LineOut("HOST.CFG", LockPort);
  669.     q=LineOut("HOST.CFG", SecureSystem);    
  670.     q=stream("HOST.CFG",C,"close");
  671.     DispLW("OK^M^J");
  672.     Return "";
  673.  
  674. MakeUserList:
  675.     LogLW("Created User File");
  676.     DispLW(" Creating user list file...");
  677.     q=stream("HOST.USR",C,"open write");
  678.     q=stream("HOST.USR",C,"close");
  679.     DispLW("OK^M^J");
  680.     Return "";
  681.  
  682.  
  683. HostReadChar:
  684.    ReturnString=GetKeyLW();
  685.  
  686.    if (ReturnString="TIMEOUT") | ((GetLW(Online)==0) & (\GetLW(LocalOnly))) then
  687.       Signal LostCarrier;
  688.  
  689.    return ReturnString;
  690.  
  691.  
  692. HostReadString:
  693. arg StartString, MaxStrLen
  694.  
  695.    ReturnString=GetStrLW(StartString, MaxStrLen);
  696.    if (ReturnString="TIMEOUT") | ((GetLW(Online)=0) & (\GetLW(LocalOnly))) then
  697.       Signal LostCarrier;
  698.  
  699.    return ReturnString;
  700.  
  701. StopHost:
  702.    LogLW("Host Mode Stopped");
  703.    SetLW(FGColor,7);
  704.    SetLW(BGColor,0);
  705.    ClrScrLW();
  706.    DispLW("Host mode stopped^M^J");
  707.    exit;
  708.