home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / TE2HOST.ZIP / TE2HOST.SCR < prev    next >
Text File  |  1990-12-28  |  3KB  |  105 lines

  1. ;; --------------------------------------------------------------------------
  2. ;;
  3. ;; TE2Host.scr -- Host mode script suite for TE/2
  4. ;;                Copyright 1990, Oberon Software, All rights reserved
  5. ;;
  6. ;; --------------------------------------------------------------------------
  7.  
  8.   ;; --------------------------
  9.   ;; Some global configuration:
  10.  
  11. global integer maximumBaud  = 2400                 ;; Maximum supported baud rate
  12. global string  HomePath     = "d:/te2/host"        ;; path for config files
  13. global string  PublicPath   = "d:/te2/host/public" ;; path for downloadable files
  14. global string  HostULPath   = "d:/te2/host/ul"     ;; path for user uploads
  15.  
  16.   ;; -----------------------------------
  17.   ;; Inter-file communication variables:
  18.  
  19. global integer MenuLevel                           ;; Current Menu State
  20. global integer XFerType                            ;; File transfer type
  21. global integer smMenuExit                          ;; Local sysop menu result
  22.  
  23.   ;; ----------------------------------------
  24.   ;; Menu Configuration Variable (Constants):
  25.  
  26. global integer MLevelMain   = 0
  27. global integer MLevelFile   = 1
  28. global integer MLevelMail   = 2
  29. global integer MLevelProto  = 98
  30. global integer MLevelSysop  = 99
  31.  
  32. global integer XFerUpLoad   = 0
  33. global integer XFerDownLoad = 1
  34.  
  35.   ;; -----------------------------------------------------------------------
  36.   ;; Colors, these are modified in subroutine SetTerminal (in HostMode.scr):
  37.  
  38. global string  DfltAttr     = "^[[36;0m"
  39. global string  BoldOn       = "^[[33;1m"
  40. global string  BoldOff      = "^[[36;0m"
  41. global string  WarnOn       = "^[[37;1m"
  42. global string  WarnOff      = "^[[36;0m"
  43.  
  44. ;; --------------------------------------------------------------------------
  45. ;; ---- Local variables:
  46.  
  47. string  OrigPath                          ;; buffer for original path
  48. string  OrigScrPath                       ;; buffer for original script path
  49. string  OrigDLPath                        ;; buffer for original download path
  50. string  myModemInit  = "ATE0 V1 X6 ^M"    ;; modem init string
  51. integer stdParity    = 0
  52. integer stdWordLen   = 8
  53. integer stdStopBits  = 0
  54.  
  55.  
  56.   ;; ------------------------------------------------------------------------
  57.   ;; Perform all initialization for the environment and terminal settings
  58.   ;;  as well as for the modem here.  This is called each time before
  59.   ;;  (re)entering call wait mode.
  60.  
  61. subroutine SetModemParms
  62.  
  63.   termecho(FALSE)
  64.   localecho(FALSE)
  65.   ChDisk(HomePath)
  66.   ChDir(HomePath)
  67.   setparms(-1, maximumBaud, stdParity, stdWordLen, stdStopBits)
  68.   transmit("%s", myModemInit)
  69.   sleep(2500)
  70.  
  71. endsub
  72.  
  73.  
  74. ;; --------------------------------------------------------------------------
  75. ;; --------------------------------------------------------------------------
  76.  
  77.  
  78. program
  79.  
  80.   OrigPath     = curdir
  81.   OrigScrPath  = scriptPath
  82.   OrigDLPath   = downloadPath
  83.   downloadPath = HostULPath
  84.   scriptPath   = OrigScrPath + "/host"
  85.   do
  86.     cls()
  87.     message("TE/2 Host Script^M^J")
  88.     gosub SetModemParms
  89.     message("Waiting for call...^M^J")
  90.     run("wait4Cal")
  91.     if connected
  92.       run("hostmode")
  93.     else
  94.       break
  95.     endif
  96.   loop
  97.   message("^M^JTE/2 Host Script ended.^M^J")
  98.   ChDisk(OrigPath)
  99.   ChDir(OrigPath)
  100.   scriptPath   = OrigScrPath
  101.   downloadPath = OrigDLPath
  102.   termecho(TRUE)
  103.   end
  104.  
  105.