home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / boyan1.zip / HOST.BSC < prev    next >
Text File  |  1989-02-01  |  13KB  |  271 lines

  1. \\ BOYAN HOST MODE Version 4.0.
  2. \\ Script files:  HOST.BSC,  HOSTMSGS.BSC
  3. \\ Customizable Host Mode script providing:
  4. \\   * 2 levels of password protection
  5. \\   * Welcome bulletin file "WELCOME.MSG"
  6. \\   * Named message entry into files with .MSG suffix.  Auto-line numbering.
  7. \\   * Usage log lists names and on-line times of all host callers
  8. \\   * Message functions: list all messages, read or delete a message.
  9. \\   * File uploads and downloads using any BOYAN protocol, Zmodem, Kermit
  10. \\   * Remote Shell to DOS, Host Mode shutdown
  11. \\
  12. \\ The following 4 variables are set automatically by the HOST Action Module.
  13. \\ Use Configuration Area "A", Action Module "HOST" to change those settings.
  14. \\ %V1 = Host Password
  15. \\ %V2 = Secondary Password, for DOS Shells and other "System" commands
  16. \\ %V3 = MODEM if connection is over a modem,
  17. \\       DIRECT if connection is direct,
  18. \\       LOCAL if we're doing a local host mode test.
  19. \\ %V4 = The host disk directory (used for messages and file transfers)
  20. \\ When a caller is online, %V6 holds the caller's name.
  21. \\ Note the use of the "\(" shortcut to cycle the host if carrier drops.
  22.  
  23. |InitHost
  24. \IE-%AN,HOST[\AM[H]]                 \\ load HOST module if not yet loaded.
  25. \IE-%AN,HOST[\DM[Unable to load HOST module.]\AB] \\ abort if can't load BAM
  26. \ZS\ST[Invoking host mode...]        \\ zap screen, status message
  27. \DM1[-------- BOYAN Host 4.0 --------] \\ display message
  28. \DM2[         Initializing...        ]
  29. \CP[None]                            \\ use No parity in host mode
  30. \BB-                                 \\ turn off Beeps & Bells
  31. \KO[0]                               \\ script keyboard timeout = 0 seconds
  32. \SP[0]\SL[0]                         \\ set char pacing and line pacing to 0
  33. \UM[HOST MODE INVOKED]               \\ add usage message to BOYAN.USE
  34. \MV5[12]                             \\ Save "After Script" macro #12 in %V5.
  35. \SV6[]                               \\ %V6 will be used later for username
  36. \SM12[\SC"[HOST;Reset"]]             \\ After script finishes, run Reset block
  37. \MV7[119]                            \\ Save current Shortcut macro \( in %V7.
  38. \SM119[\IV3+MODEM"[\CA-"[\GS"[HOST;Cycle"]"]"]]  \\ sets Shortcut macro \(
  39. \\  Now, \( will automatically cycle the host if the carrier signal is lost.
  40. \IV3-MODEM[\GB[Welcome]]             \\ Go straight to welcome if not MODEM.
  41. \GB[WaitForCall]                     \\ Wait for a call
  42.  
  43.  
  44. |WaitForCall
  45. \EC-\LF-                             \\ turn Echo & LF's off
  46. \CA+[\GB[Welcome]]                   \\ if already connected, welcome caller!
  47. ATX4S0=0{                            \\ Tell modem not to auto-answer
  48. \WF[OK]~~                            \\ expect "OK" message from modem
  49. \DM1[-------- BOYAN Host 4.0 --------]
  50. \DM2[       Waiting for RING...      ]
  51. \DM3[ Press <Esc> to quit Host Mode. ]
  52. \TO[255]                             \\ This means to wait forever...
  53. \WF[RING]                            \\ ... for the first "RING" message.
  54. \TO[7]                               \\ wait 7 secs for each add'l ring
  55. \RE`0`[\WF[RING]\IW-[\GB[WaitForCall]]]  \\ Wait for `0` more rings;
  56.                                      \\ If not enough RING's, go back to top.
  57. ~ATA{                                \\ Tell modem to establish connection
  58. \TO[30]\WF[CONNECT]                  \\ Wait 30 seconds for "CONNECT"
  59. \IW-[\GB[Cycle]]~                    \\ If no connect, go cycle now.  Else:
  60. \\(Add "\\" before next five lines if you have your comm port fixed at 19200)
  61. \IF+96[\CS[9600]\GB[Welcome]]        \\ ... Change our speed parameter
  62. \IF+48[\CS[4800]\GB[Welcome]]        \\ to match the number given in the
  63. \IF+24[\CS[2400]\GB[Welcome]]        \\ modem's connect message...
  64. \IF+12[\CS[1200]\GB[Welcome]]        \\   [Then go to the "Welcome" block.]
  65. \CS[300]                             \\ ...or 300 baud if just "CONNECT"
  66. \GB[Welcome]                         \\
  67.  
  68.  
  69. |Welcome
  70. \IE-%AN,HOST[\AM[H]]                 \\ make sure we're using Host module
  71. \DM1[-------- BOYAN Host 4.0 --------]
  72. \DM2[     Host mode activated!       ]
  73. \DM3[     Connection type: %V3     ]
  74. \EC+\LF+                             \\ Echo & LF's on while host active..
  75. \IV3+MODEM[\PA[6]]                   \\ if MODEM connection pause 6 seconds
  76. {{{
  77. Welcome to BOYAN 4.0 Host!{{
  78. \PL                                  \\ purge line of incoming characters
  79. Press <Enter> to begin: `
  80. \TO[40]\RV0[0]                       \\ give user 40 seconds to respond
  81. \IW-[\GB[LogOff]]                    \\ if no response, log user off!
  82. \(                                   \\ Shortcut: cycle host if carrier lost
  83. {{Enter your first and last name: `  \\ prompt for user's name
  84. \RV6[50]\(                           \\ Reads up to 50 chars into %V6
  85. \UM[| Host username: %V6]            \\ add Usage Message to BOYAN.USE
  86. \BL[GetPassword]\(                   \\ sets %V0 = what they type in.
  87. \IE-%V0,%V1[\BL[GetPassword]\(]      \\ If incorrect, give second chance.
  88. \IE-%V0,%V1[\BL[GetPassword]\(]      \\ Still wrong?  Third and final chance!
  89. \IE-%V0,%V1[\GB[WrongPassword]\(]    \\ If password still wrong, log user off.
  90. {                                    \\ If "WELCOME.MSG" file exists in host
  91. \FE+%V4welcome.msg[\ULa[%V4welcome.msg]]  \\ directory, then send it.
  92. \GB[Menu]                            \\ Then continue to the Main Menu.
  93.  
  94.  
  95. |GetPassword
  96. {Enter the password: `               \\ prompt for pw
  97. \RV0[15]                             \\ Reads up to 15 chars from user
  98.  
  99.  
  100. |Menu
  101. {
  102. BOYAN-Host select ([M]essages, [F]iles, [J]ump-DOS, [G]oodbye): `
  103. \RV0[1]\(                            \\ Read 1 char into %V0
  104. \IV0+M[\GS[HOSTMSGS;Messages]]       \\ If "M" invoke HOSTMSGS script
  105. \IV0+F[\GB[Files]]                   \\ If "F" go to "Files" block
  106. \IV0+J[\GB[Shell]]                   \\ If "J" go to "Shell" block
  107. \IV0+G[\GB[Goodbye]]                 \\ If "G" go to "Goodbye" block
  108. \GB[Menu]                            \\ otherwise loop back to Menu.
  109.  
  110.  
  111. |Files                               \\ Files sub-menu
  112. {
  113. Files Select ([L]ist, [D]ownload, [U]pload, [Q]uit): \RV0[1]\(
  114. \IV0+Q[\GB[Menu]]                    \\ if Q, quit back to main menu
  115. \IV0+L[\GB[ListFiles]]
  116. \IV0+D[\GB[Download]]
  117. \IV0+U[\GB[Upload]]
  118. \GB[Files]                           \\ if not L,D,or U, go back and re-ask.
  119.  
  120.  
  121. |ListFiles                           \\ list files in host directory
  122. {
  123. Files available for downloading:{
  124. \DC[dir %V4 > %V4`hosttemp.fil]      \\ use DOS to create list in temp. file
  125. \ULa[%V4`hosttemp.fil]               \\ then ASCII-upload that file.
  126. \GB[Files]                           \\ return to "Files" menu
  127.  
  128.  
  129. |Download
  130. \BL[SetProtocol]                     \\ selected protocol stored in %V9
  131. \IV9+Q[\GB[Files]]                   \\ back to files menu if no protocol
  132. {
  133. Enter name of file to download: `
  134. \RV0[38]{\(                          \\ read filename into %V0
  135. \II+"\,%V0[\BL[SecondPW]\IV0+CANCEL[\GB[Files]]  \\ if there is a "\" in the
  136.                                      \\ filename, then require 2nd password.
  137. \II-"\,%V0[\SV0[%V4%V0]]             \\ Otherwise, add host file path to name.
  138. \FE-%V0[File not found.{\GB[Files]]  \\ end block if file doesn't exist
  139. {
  140. Sending:  %V0{
  141. Protocol: [%V9]{
  142. Start the download on your end now.{\(
  143. \IV9+A[Press <Return> when ready: \WL{] \\ expect <CR> if ASCII download
  144. \UL%V9[%V0]\(                        \\ send file %V0 using protocol %V9
  145. \IV9+A[^K]                           \\ send <Ctrl-K> to close ASCII download
  146. {
  147. \IT+[Download successful.|Download unsuccessful.]{
  148. \GB[Files]                           \\ go back to files menu
  149.  
  150.  
  151. |Upload
  152. \BL[SetProtocol]                     \\ selected protocol stored in %V9
  153. \IV9+Q[\GB[Files]]                   \\ back to files menu if no protocol
  154. {
  155. Enter name of file to upload: `
  156. \RV0[38]{\(                          \\ read filename into %V0
  157. \IV0+[\GB[Files]]                    \\ back to menu if no filename entered
  158. \II+"\,%V0[\BL[SecondPW]`\IV0+CANCEL[\GB[Files]] \\ if there is a "\" in the
  159.                                      \\ filename, then require 2nd password.
  160. \II-"\,%V0[\SV0[%V4%V0]]             \\ Otherwise, add host file path to name.
  161. \II-.,%V0[\SV0[%V0.]]                \\ Add "." to filename if not there
  162. \FE+%V0[File already exists.{\GB[Files]]  \\ go back if file already here
  163. {
  164. Receiving: %V0{
  165. Protocol:  [%V9]{
  166. Start the upload on your end now.{\(
  167. \PA[4]                               \\ wait 4 secs before expecting file
  168. \DL%V9[%V0]\(                        \\ receive file %V0 using protocol %V9
  169. {
  170. \IT+[Upload successful.|Upload unsuccessful.]{
  171. \GB[Files]                           \\ go back to files menu
  172.  
  173.  
  174. |SetProtocol    \\ returns the protocol letter selected, in %V9
  175. {
  176. Protocol Select ([A] ASCII, [X] Xmodem, [C] CRC-Xmodem,  [1] 1K-Xmodem,{
  177.    [Y] Ymodem, [G] G-Ymodem,
  178. \IP+K[ [K] Kermit,]                  \\ add Kermit and Zmodem to the menu
  179. \IP+Z[ [Z] Zmodem,]                  \\ only if they are available
  180.  [Q] Quit): `                        \\ add "quit" option to menu
  181. \RV9[1]{\(                           \\ read one character into %V9.
  182. \IV9+Q[\EB]                          \\ End block if %V9 is a valid
  183. \IV9+A[\EB]                          \\ selection from the menu.
  184. \IV9+X[\EB]
  185. \IV9+C[\EB]
  186. \IV9+1[\EB]
  187. \IV9+Y[\EB]
  188. \IV9+G[\EB]
  189. \IV9+K[\IP+K[\EB]]                   \\ check for existence of external
  190. \IV9+Z[\IP+Z[\EB]]                   \\ protocol before okaying it.
  191. Invalid protocol.{                   \\ otherwise report an error, and go
  192. \GB[SetProtocol]                     \\ back to ask for another protocol.
  193.  
  194.  
  195. |SecondPW
  196. Enter secondary password: \RV8[12]\( \\ prompt for secondary password
  197. \IE-%V8,%V2[Wrong password.{\SV0[CANCEL]]  \\ sets %V0 to CANCEL if wrong
  198.  
  199.  
  200. |Shell
  201. {
  202. \BL[SecondPW]                        \\ require secondary password
  203. \IV0+CANCEL[\GB[Menu]]               \\ if no good, go back to main menu
  204. \UM[|   Host user Jumped to DOS.]    \\ add usage message to BOYAN.USE
  205. {
  206. \IV3+LOCAL[\JD\GB[Menu]]             \\ if Local Host test, just Jump to DOS.
  207. Type "EXIT" to return to BOYAN-Host.{\\ otherwise do the following:
  208. \SV0[%V4`hosttemp.bat]               \\ Create a new batch file HOSTTEMP.BAT
  209. \FE+%V0[\DC[del %V0]]                \\ which has three lines:
  210. \AF%V0[CTTY COM%MD]                  \\   CTTY COM1    (or COM2,COM3,COM4)
  211. \AF%V0[COMMAND]                      \\   COMMAND
  212. \AF%V0[CTTY CON]                     \\   CTTY CON
  213. \(                                   \\ This shortcut insures carrier detect
  214. \DC[%V4`hosttemp]                    \\ Then execute the batch file.
  215. \GB[Menu]                            \\ go back to main menu
  216.  
  217.  
  218. |Goodbye
  219. {
  220. Goodbye select ([G]o back,  [S]hutdown host,  <CR>=hang up): `
  221. \RV0[1]{\(
  222. \IV0+G[\GB[Menu]]                    \\ If "G", return to main host menu
  223. \IV0-S[\GB[LogOff]]                  \\ If anything but "S", log them off
  224. \BL[SecondPW]                        \\ require secondary password to shutdown
  225. \IV0+CANCEL[\GB[Goodbye]]            \\ if wrong password, back to above
  226. \GB[ShutDown]                        \\ Go shut down!
  227.  
  228.  
  229. |WrongPassword
  230. \UM[| Incorrect password '%V0'; user denied entrance.]\\ add BOYAN.USE message
  231. \GB[LogOff]                          \\ User will be hung up.
  232.  
  233.  
  234. |LogOff
  235. {
  236. Thank you for using BOYAN host!{     \\ logoff message
  237. \IV3+MODEM[\PA[5]\HU~~~]             \\ If MODEM connection, pause & hang up.
  238. \GB[Cycle]                           \\ Then cycle for next caller.
  239.  
  240.  
  241. |Cycle                \\ This block automatically runs between all calls.
  242. \IV3+MODEM[\HU\PL]                   \\ Make sure we've hung up, & purge line
  243. \DM1[-------- BOYAN Host 4.0 --------]
  244. \DM2[            Cycling...          ]
  245. \DM3[ Press <Esc> to quit Host Mode. ]
  246. \PA[3]                               \\ Pause 3 seconds, then...
  247. \DM1,[Host cycled %V6 at %HR:%MI.]   \\ Display cycled message on screen.
  248. \SV6[]                               \\ Erase the username from %V6
  249. \IV3+MODEM[\GB[WaitForCall]]         \\ If modem connection, wait for call;
  250. \GB[Welcome]                         \\ otherwise, go start up host.
  251.  
  252.  
  253. |ShutDown
  254. {BOYAN Host shut down.{
  255. \IV3+MODEM[\PA[2]\HU]                \\ Pause & hang up.
  256. \PA[2]                               \\ 2-second pause...
  257. \AB                                  \\ Abort script
  258.  
  259.  
  260. |Reset       \\ Auto-macro #12 runs this block after HOST is aborted!
  261. \DM1[-------- BOYAN Host 4.0 --------]
  262. \DM2[       Host mode finished.      ]
  263. \DM3[Press <Alt-I> to re-invoke host.]
  264. \UM[HOST MODE SHUT DOWN]             \\ add usage message to BOYAN.USE
  265. \SM12[%V5]                           \\ reset macro #12 to what it was before
  266. \SM119[%V7]                          \\ reset Shortcut \( to what it was "
  267. \IV5+\SC"[HOST;Reset"][\SM12[]]      \\ make sure we don't have an endless loop
  268. \BB+                                 \\ Beeps & Bells back on
  269. \AM[%AP]                             \\ change back to previous action module
  270. \AB                                  \\ Abort script
  271.