home *** CD-ROM | disk | FTP | other *** search
/ Chip: Special Survival Kit / Chip_Special_Survival_Kit_fuer_PC_Anwender.iso / 05sonst / telemate / _telemat.exe / HOST.EXE / HCONFIG.SCR next >
Text File  |  1993-07-20  |  6KB  |  239 lines

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