home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / tm211_2.zip / HOST.EXE / HCONFIG.SCR next >
Text File  |  1990-05-25  |  6KB  |  216 lines

  1. ;
  2. ; HCONFIG.SCR by Tsung Hu, 21 May, 1990
  3. ;
  4.  
  5. NEWUSERLEVEL = 1             ; new user level
  6. SYSOPLEVEL = 2               ; sysop level
  7. DETECTBAUD = 1               ; set to 0 if COM baud rate is locked
  8. INITIALBAUD = 2400           ; initial baud rate (highest baud rate)
  9. YELLTIME = 3                 ; amount of time to display the alarm
  10. YELLSOUND = 1                ; amount of time to ring the alarm
  11. HOSTDIR = "\TM"              ; directory holding *.HST
  12. DOWNLOADDIR = "\TM"          ; host download directory
  13.  
  14. COMPORT = "1"
  15.  
  16.    procedure Pause
  17.    string ch
  18.    print
  19.    print "Press [Enter] to continue ",
  20.    repeat
  21.       inputch ch
  22.    until success
  23.    print
  24.    print
  25.    endproc
  26.  
  27. open "HSHELL.BAT"            ; [S]hell batch file
  28. if not success
  29.    print
  30.    print
  31.    print "Which COM port is your modem connected to  (1-8) ?   COM",
  32.    repeat
  33.      inputch COMPORT
  34.      if success
  35.         print COMPORT
  36.         strpos "12345678",COMPORT,pos
  37.         if pos=0
  38.            print "Which COM port is your modem connected to  (1-8) ?   COM",
  39.         endif
  40.      endif
  41.    until success and pos>0
  42.    print
  43.    if COMPORT<>"1" and COMPORT<>"2"
  44.       print "Due to DOS limit, only COM1 and COM2 is supported for"
  45.       print "the [S]hell command in host mode.  However, you may"
  46.       print "create your own HSHELL.BAT and use a third-party program,"
  47.       print "such as DOORWAY, which allows you to use COM",COMPORT
  48.    else
  49.       create "HSHELL.BAT"
  50.       if success
  51.          print "Creating HSHELL.BAT, the batch file for [S]hell command"
  52.          write "CTTY COM",COMPORT
  53.          write "COMMAND"
  54.          write "CTTY CON"
  55.          write "EXIT"
  56.          close
  57.       else
  58.          print "Cannot to create HSHELL.BAT"
  59.       endif
  60.    endif
  61.    Pause
  62. else
  63.    close                     ; already exist, skip it
  64. endif
  65.  
  66. open "HCONFIG.HST"
  67. string s
  68. if success
  69.    read s
  70.    atoi s,NEWUSERLEVEL       ; new user level
  71.    read s
  72.    atoi s,SYSOPLEVEL         ; sysop level
  73.    read s
  74.    atoi s,DETECTBAUD         ; detect baud rate
  75.    read s
  76.    atoi s,INITIALBAUD        ; initial baud rate
  77.    read s
  78.    atoi s,YELLTIME           ; yell time
  79.    read s
  80.    atoi s,YELLSOUND          ; yell sound
  81.    read HOSTDIR              ; directory containing H*.HST
  82.    read DOWNLOADDIR          ; download directory
  83.                              ; (upload always go to Telemate
  84.                              ;  downlaod directory)
  85.    close
  86. endif
  87.  
  88. finish = 0
  89. while not finish
  90.    clear text
  91.    print "A: New user level     : ",NEWUSERLEVEL
  92.    print "B: Sysop level        : ",SYSOPLEVEL
  93.    print "C: Detect baud rate   : ",
  94.    if DETECTBAUD
  95.       print "ON"
  96.    else
  97.       print "OFF"
  98.    endif
  99.    print "D: Initial baud rate  : ",INITIALBAUD
  100.    print "E: Yell time          : ",YELLTIME," seconds"
  101.    print "F: Yell sound         : ",YELLSOUND," seconds"
  102.    print "G: Host directory     : ",HOSTDIR
  103.    print "H: Download directory : ",DOWNLOADDIR
  104.    print
  105.    print "S: Save configuration and run host mode"
  106.    print "Q: Abort configuration"
  107.    print
  108.    print "Which option: ",
  109.    repeat
  110.       inputch ch
  111.    until success
  112.    print ch
  113.    print
  114.    print
  115.  
  116.    switch ch
  117.       case "A":
  118.          print "Enter new user level: ",
  119.          input s
  120.          ss = ""
  121.          concat ss,s
  122.          if ss<>""
  123.             atoi ss,NEWUSERLEVEL
  124.          endif
  125.       case "B":
  126.          print "Enter sysop level: ",
  127.          input s
  128.          ss = ""
  129.          concat ss,s
  130.          if ss<>""
  131.             atoi ss,SYSOPLEVEL
  132.          endif
  133.       case "C":
  134.          DETECTBAUD = not DETECTBAUD
  135.       case "D":
  136.          print "Enter initial baud rate: ",
  137.          input s
  138.          ss = ""
  139.          concat ss,s
  140.          if ss<>""
  141.             atoi ss,baud
  142.          endif
  143.          switch baud
  144.             case   300: INITIALBAUD = baud
  145.             case  1200: INITIALBAUD = baud
  146.             case  2400: INITIALBAUD = baud
  147.             case  4800: INITIALBAUD = baud
  148.             case  9600: INITIALBAUD = baud
  149.             case 19200: INITIALBAUD = baud
  150.             case 38400: INITIALBAUD = baud
  151.             otherwise : print
  152.                         print "Invalid value"
  153.                         print
  154.                         Pause
  155.          endswitch
  156.       case "E":
  157.          print "Enter yell time (0 to turn off): ",
  158.          input s
  159.          ss = ""
  160.          concat ss,s
  161.          if ss<>""
  162.             atoi ss,YELLTIME
  163.          endif
  164.       case "F":
  165.          print "Enter yell sound length (0 to turn off): ",
  166.          input s
  167.          ss = ""
  168.          concat ss,s
  169.          if ss<>""
  170.             atoi ss,YELLSOUND
  171.          endif
  172.       case "G":
  173.          print "Enter host directory which contains H*.HST: ",
  174.          input s
  175.          ss = ""
  176.          concat ss,s
  177.          if ss<>""
  178.             HOSTDIR = ss
  179.          endif
  180.       case "H":
  181.          print "Enter host download directory: ",
  182.          input s
  183.          ss = ""
  184.          concat ss,s
  185.          if ss<>""
  186.             DOWNLOADDIR = ss
  187.          endif
  188.       case "S":
  189.          delete "HCONFIG.HST"
  190.          create "HCONFIG.HST"
  191.          if not success
  192.             print "Cannot create HCONFIG.HST"
  193.             print "Configuration aborted"
  194.             finish = 1
  195.          else
  196.             write NEWUSERLEVEL
  197.             write SYSOPLEVEL
  198.             write DETECTBAUD
  199.             write INITIALBAUD
  200.             write YELLTIME
  201.             write YELLSOUND
  202.             write HOSTDIR
  203.             write DOWNLOADDIR
  204.             close
  205.             print "Configuration completed"
  206.             Pause
  207.             print "Starting host mode"
  208.             script "HOST"
  209.          endif
  210.       case "Q":
  211.          print "Configuration aborted"
  212.          finish = 1
  213.    endswitch
  214. endwhile
  215.  
  216.