home *** CD-ROM | disk | FTP | other *** search
/ The Best of the Best / _.img / 02172 / tele1.exe / HOST.EXE / HCONFIG.SCR next >
Text File  |  1992-01-03  |  6KB  |  227 lines

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