home *** CD-ROM | disk | FTP | other *** search
/ The CIA World Factbook 1992 / k3bimage.iso / sel / 02 / 0054 / bbs.cmd next >
Encoding:
Text File  |  1991-12-02  |  10.9 KB  |  617 lines

  1. ;
  2. ; BBS.cmd  -  simple Bulletin Board emulation for ProComm v 2.4.2
  3. ; Condensed program
  4. ;
  5. Setup:
  6. GoSu SetCommParam
  7. StartOfSession:
  8. If Conn
  9. Else
  10.    GoTo StartOfSession
  11. EndI
  12. GoSu Login
  13. Assi S9 "!"
  14. GoSu LoginOK
  15. GoSu OpeningStatement
  16. GoTo MainMenu
  17.  
  18. SetCommParam:
  19. Set Port COM1
  20. Set Baud 9600
  21. Set Data 8
  22. Set Dupl Half
  23. Set Pari None
  24. Set CR_I CR_L
  25. Set CR_O CR_L
  26. Set Flow On
  27. Set Alar Off
  28. Set Soun Off
  29. Set ASCI Line 1
  30. Set ASCI Echo On
  31. Retu
  32.  
  33. CheckUsers:
  34. Swit S6
  35.    Case "VERNON"
  36.       Find S7 "VED"
  37.       If Foun
  38.          Assi S9 "OK"
  39.          Retu
  40.       EndI
  41.    EndC
  42.    Case "******"
  43.       Find S7 "******"
  44.       If Foun
  45.          Assi S9 "OK"
  46.          Retu
  47.       EndI
  48.    EndC
  49.    Case "******"
  50.       Find S7 "******"
  51.       If Foun
  52.          Assi S9 "OK"
  53.          Retu
  54.       EndI
  55.    EndC
  56.    Case "******"
  57.       Find S7 "******"
  58.       If Foun
  59.          Assi S9 "OK"
  60.          Retu
  61.       EndI
  62.    EndC
  63.    Case "******"
  64.       Find S7 "******"
  65.       If Foun
  66.          Assi S9 "OK"
  67.          Retu
  68.       EndI
  69.    EndC
  70.    Case "******"
  71.       Find S7 "******"
  72.       If Foun
  73.          Assi S9 "OK"
  74.          Retu
  75.       EndI
  76.    EndC
  77.    Case "******"
  78.       Find S7 "******"
  79.       If Foun
  80.          Assi S9 "OK"
  81.          Retu
  82.       EndI
  83.    EndC
  84.    Case "******"
  85.       Find S7 "******"
  86.       If Foun
  87.          Assi S9 "OK"
  88.          Retu
  89.       EndI
  90.    EndC
  91.    Case "******"
  92.       Find S7 "******"
  93.       If Foun
  94.          Assi S9 "OK"
  95.          Retu
  96.       EndI
  97.    EndC
  98.    Case "******"
  99.       Find S7 "******"
  100.       If Foun
  101.          Assi S9 "OK"
  102.          Retu
  103.       EndI
  104.    EndC
  105. EndS
  106. Assi S9 "BAD"
  107. Retu
  108.  
  109. OpeningStatement:
  110. IsFi S6
  111. If Succ
  112.    Send ASCII S6
  113. EndI
  114. Tran "!Press any key to begin ..."
  115. If Conn
  116. Else
  117.    GoTo EndOfComm
  118. EndI
  119. RGet S6 1 120
  120. If Fail
  121.    GoTo TimeOut
  122. EndI
  123. Retu
  124.  
  125. Login:
  126. Assi S8 "pass 1"
  127. Tran "! ! ! ! ! ! ! ! ! !CONNECTION ESTABLISHED! !"
  128. LoginLoop:
  129. Tran "!Username : "
  130. If Conn
  131. Else
  132.    GoTo EndOfComm
  133. EndI
  134. RGet S6 8 60
  135. If Fail
  136.    GoTo TimeOut
  137. EndI
  138. Tran "!Password : "
  139. If Conn
  140. Else
  141.    GoTo EndOfComm
  142. EndI
  143. RGet S7 20 60
  144. If Fail
  145.    GoTo TimeOut
  146. EndI
  147. GoSu CheckUsers
  148. Find S9 "OK"
  149. If Foun
  150.    Retu
  151. Else
  152.    Swit S8
  153.       Case "pass 1"
  154.          Assi S8 "pass 2"
  155.          GoTo TryAgain
  156.       EndC
  157.       Case "pass 2"
  158.          Assi S8 "pass 3"
  159.          GoTo TryAgain
  160.       EndC
  161.       Case "pass 3"
  162.          GoTo TimeOut
  163.       EndC
  164.    EndS
  165. EndI
  166. TryAgain:
  167. Tran "!Invalid login ...!"
  168. GoTo LoginLoop
  169.  
  170. LoginOK:
  171. Assi S7 " "
  172. Tran "! !Welcome "
  173. Tran S6
  174. Tran "!"
  175. Tran S9
  176. Retu
  177.  
  178. MainMenu:
  179. Tran "! ! ! ! ! ! ! ! ! !"
  180. Tran "! ! ! ----- M A I N   M E N U -----! !"
  181. Tran " 1. Directory of Files!"
  182. Tran " 2. Download Files!"
  183. Tran " 3. Upload Files!"
  184. Tran " 4. Leave a Message with SYSOP!"
  185. Tran " 5. Log Out!"
  186. Tran " ?. HELP! !"
  187. Tran " Make a selection -> "
  188. If Conn
  189. Else
  190.    GoTo EndOfComm
  191. EndI
  192. RGet S6 1 240
  193. Tran "!"
  194. If Fail
  195.    GoTo TimeOut
  196. EndI
  197. Swit S6
  198.    Case "1"
  199.       GoSu FileDir
  200.    EndC
  201.    Case "2"
  202.       GoSu DownMenu
  203.    EndC
  204.    Case "3"
  205.       GoSu UpMenu
  206.    EndC
  207.    Case "4"
  208.       GoSu SysopMessage
  209.    EndC
  210.    Case "5"
  211.       GoSu LogOut
  212.    EndC
  213.    Case "?"
  214.       GoSu HelpMain
  215.    EndC
  216.    Defa
  217.       Tran "^G Invalid key was pressed.!"
  218.    EndC
  219. EndS
  220. GoTo MainMenu
  221.  
  222. HelpMain:
  223. Tran "! ! ! ***  H E L P  ***"
  224. Tran "! 1. Directory of Files - displayes all the files available"
  225. Tran "! for download by you. Use Ctrl-S to stop the scrolling and"
  226. Tran "! Ctrl-Q to resume."
  227. Tran "!"
  228. Tran "! 2. Download Files - displays the Download Menu, that allows"
  229. Tran "! you to download available files. See this menu for additional"
  230. Tran "! information."
  231. Tran "!"
  232. Tran "! 3. Upload Files - displays the Upload Menu. See this menu"
  233. Tran "! for additional information."
  234. Tran "!"
  235. Tran "! 4. Leave a message for SYSOP - allows you to send a message"
  236. Tran "! to the Systems Operator. Type in the text when prompted and"
  237. Tran "! press Ctrl-Z when done. You have five minutes in which to"
  238. Tran "! enter information."
  239. Tran "! !Press any key ..."
  240. If Conn
  241. Else
  242.    GoTo EndOfComm
  243. EndI
  244. RGet S6 1 120
  245. If Fail
  246.    GoTo TimeOut
  247. EndI
  248. Retu
  249.  
  250. DownMenu:
  251. Assi S7 "Xmodem"
  252. DownLoop:
  253. Tran "! ! ! ! ! ! ! ! ! !"
  254. Tran "! ! ! ----- D O W N L O A D -----! !"
  255. Tran " 1. Directory of Files!"
  256. Tran " 2. Protocol("
  257. Tran S7
  258. Tran ")!"
  259. Tran " 3. Download a file!"
  260. Tran " 4. Retu to MAIN MENU!"
  261. Tran " 5. Log Out!"
  262. Tran " ?. HELP! !"
  263. Tran " Make a selection -> "
  264. If Conn
  265. Else
  266.    GoTo EndOfComm
  267. EndI
  268. RGet S6 1 240
  269. Tran "!"
  270. If Fail
  271.    GoTo TimeOut
  272. EndI
  273. Swit S6
  274.    Case "1"
  275.       GoSu FileDir
  276.    EndC
  277.    Case "2"
  278.       GoSu ChooseProtocol
  279.    EndC
  280.    Case "3"
  281.       GoSu FileDown
  282.    EndC
  283.    Case "4"
  284.       Retu
  285.    EndC
  286.    Case "5"
  287.       GoSu LogOut
  288.    EndC
  289.    Case "?"
  290.       GoSu HelpDown
  291.    EndC
  292.    Defa
  293.       Tran "^G Invalid key was pressed.!"
  294.    EndC
  295. EndS
  296. GoTo DownLoop
  297.  
  298. HelpDown:
  299. Tran "! ! ! ***  H E L P  ***"
  300. Tran "! 1. Directory of Files - displayes all the files available"
  301. Tran "! for download by you. Use Ctrl-S to stop the scrolling and"
  302. Tran "! Ctrl-Q to resume."
  303. Tran "!"
  304. Tran "! 2. Protocol - displays the Protocol Menu, that allows"
  305. Tran "! you to select the Download File Transfer mode. The mode"
  306. Tran "! that appears in the parentheses is the currently selected"
  307. Tran "! protocol. See this menu for additional information."
  308. Tran "!"
  309. Tran "! 3. Download a File - enter the name of a file to download."
  310. Tran "! If the file exists, you will be prompted to prepare for"
  311. Tran "! download. NOTE: make sure you have the proper protocol set."
  312. Tran "! When the transfer is complete, the Download Menu should"
  313. Tran "! appear."
  314. Tran "! !Press any key ..."
  315. If Conn
  316. Else
  317.    GoTo EndOfComm
  318. EndI
  319. RGet S6 1 120
  320. If Fail
  321.    GoTo TimeOut
  322. EndI
  323. Retu
  324.  
  325. UpMenu:
  326. Assi S7 "Xmodem"
  327. UpLoop:
  328. Tran "! ! ! ! ! ! ! ! ! !"
  329. Tran "! ! ! ----- U P L O A D -----! !"
  330. Tran " 1. Protocol("
  331. Tran S7
  332. Tran ")!"
  333. Tran " 2. Upload a file!"
  334. Tran " 3. Retu to MAIN MENU!"
  335. Tran " 4. Log Out!"
  336. Tran " ?. HELP! !"
  337. Tran " Make a selection -> "
  338. If Conn
  339. Else
  340.    GoTo EndOfComm
  341. EndI
  342. RGet S6 1 240
  343. Tran "!"
  344. If Fail
  345.    GoTo TimeOut
  346. EndI
  347. Swit S6
  348.    Case "1"
  349.       GoSu ChooseProtocol
  350.    EndC
  351.    Case "2"
  352.       GoSu FileUp
  353.    EndC
  354.    Case "3"
  355.       Retu
  356.    EndC
  357.    Case "4"
  358.       GoSu LogOut
  359.    EndC
  360.    Case "?"
  361.       GoSu HelpUp
  362.    EndC
  363.    Defa
  364.       Tran "^G Invalid key was pressed.!"
  365.    EndC
  366. EndS
  367. GoTo UpLoop
  368.  
  369. HelpUp:
  370. Tran "! ! ! ***  H E L P  ***"
  371. Tran "! 1. Protocol - displays the Protocol Menu, that allows"
  372. Tran "! you to select the Upload File Transfer mode. The mode"
  373. Tran "! that appears in the parentheses is the currently selected"
  374. Tran "! protocol. See this menu for additional information."
  375. Tran "!"
  376. Tran "! 2. Upload a File - enter the name of a file to upload."
  377. Tran "! If the file does not exist, you will be prompted to prepare"
  378. Tran "! for upload. NOTE: make sure you have the proper protocol set."
  379. Tran "! When the transfer is complete, the Upload Menu should appear."
  380. Tran "! !Press any key ..."
  381. If Conn
  382. Else
  383.    GoTo EndOfComm
  384. EndI
  385. RGet S6 1 120
  386. If Fail
  387.    GoTo TimeOut
  388. EndI
  389. Retu
  390.  
  391. ChooseProtocol:
  392. Tran "! ! ! ! ! ! ! ! ! !"
  393. Tran "! ! ! ----- P R O T O C O L -----! !"
  394. Tran " 1. Xmodem!"
  395. Tran " 2. ASCII!"
  396. Tran " 3. Kermit!"
  397. Tran " 4. Retu to Previous MENU!"
  398. Tran " 5. Log Out!"
  399. Tran " ?. HELP! !"
  400. Tran " Current("
  401. Tran S7
  402. Tran ")! !"
  403. Tran " Make a selection -> "
  404. If Conn
  405. Else
  406.    GoTo EndOfComm
  407. EndI
  408. RGet S6 1 240
  409. Tran "!"
  410. If Fail
  411.    GoTo TimeOut
  412. EndI
  413. Swit S6
  414.    Case "1"
  415.       Assi S7 "Xmodem"
  416.    EndC
  417.    Case "2"
  418.       Assi S7 "ASCII"
  419.    EndC
  420.    Case "3"
  421.       Assi S7 "Kermit"
  422.    EndC
  423.    Case "4"
  424.       Retu
  425.    EndC
  426.    Case "5"
  427.       GoSu LogOut
  428.    EndC
  429.    Case "?"
  430.       GoSu HelpProto
  431.    EndC
  432.    Defa
  433.       Tran "^G Invalid key was pressed.!"
  434.    EndC
  435. EndS
  436. GoTo ChooseProtocol
  437.  
  438. HelpProto:
  439. Tran "! ! ! ***  H E L P  ***"
  440. Tran "! 1. Xmodem - this file transfer protocol is the most widely"
  441. Tran "! used. Used for binary files (ARC,COM,EXE) as well as text"
  442. Tran "! (TXT,DOC) files. Data is sent in Blocks."
  443. Tran "!"
  444. Tran "! 2. ASCII - this file transfer protocol is used to send text"
  445. Tran "! files (TXT,DOC) ONLY. It cannot transfer binary (ARC,COM,EXE)"
  446. Tran "! files."
  447. Tran "!"
  448. Tran "! 3. Kermit - this file transfer protocol is used for binary"
  449. Tran "! (ARC,COM,EXE) as well as text (TXT,DOC) files. Data is sent"
  450. Tran "! in Packets."
  451. Tran "! !Press any key ..."
  452. If Conn
  453. Else
  454.    GoTo EndOfComm
  455. EndI
  456. RGet S6 1 120
  457. If Fail
  458.    GoTo TimeOut
  459. EndI
  460. Retu
  461.  
  462. FileDir:
  463. IsFi "BBSDIR.TXT"
  464. If Fail
  465.    Tran "!Directory not available at this time."
  466. Else
  467.    Tran "! !Directory of Files!"
  468.    Send ASCII "BBSDIR.TXT"
  469.    Tran "!Press any key ..."
  470.    If Conn
  471.    Else
  472.       GoTo EndOfComm
  473.    EndI
  474.    RGet S6 1 120
  475.    If Fail
  476.       GoTo TimeOut
  477.    EndI
  478. EndI
  479. Retu
  480.  
  481. FileDown:
  482. Tran "! !Enter the filename to download!-> "
  483. If Conn
  484. Else
  485.    GoTo EndOfComm
  486. EndI
  487. RGet S6 12 120
  488. If Fail
  489.    GoTo TimeOut
  490. EndI
  491. IsFi S6
  492. If Fail
  493.    Tran "!^G!FILE NOT FOUND!Press any key ..."
  494.    If Conn
  495.    Else
  496.       GoTo EndOfComm
  497.    EndI
  498.    RGet S6 1 120
  499.    If Fail
  500.       GoTo TimeOut
  501.    EndI
  502.    Retu
  503. EndI
  504. Tran "!Prepare for download and press <CR> when ready.!"
  505. Tran "Process will abort if not started in one minute. "
  506. Wait "^M" 120
  507. If Wait
  508. Else
  509.    GoTo TimeOut
  510. EndI
  511. Swit S7
  512.    Case "Xmodem"
  513.       Send Xmodem S6
  514.    EndC
  515.    Case "ASCII"
  516.       Send ASCII S6
  517.    EndC
  518.    Case "Kermit"
  519.       Send Kermit S6
  520.    EndC
  521. EndS
  522. Retu
  523.  
  524. FileUp:
  525. Tran "! !Enter the filename to upload!-> "
  526. If Conn
  527. Else
  528.    GoTo EndOfComm
  529. EndI
  530. RGet S6 12 120
  531. If Fail
  532.    GoTo TimeOut
  533. EndI
  534. IsFi S6
  535. If Succ
  536.    Tran "!^G!FILE ALREADY EXISTS!Press any key ..."
  537.    If Conn
  538.    Else
  539.       GoTo EndOfComm
  540.    EndI
  541.    RGet S6 1 120
  542.    If Fail
  543.       GoTo TimeOut
  544.    EndI
  545.    Retu
  546. EndI
  547. Tran "!Prepare for upload and press <CR> when ready.!"
  548. Tran "Process will abort if not started in one minute. "
  549. Wait "^M" 120
  550. If Wait
  551. Else
  552.    GoTo TimeOut
  553. EndI
  554. Swit S7
  555.    Case "Xmodem"
  556.       GetF Xmodem S6
  557.    EndC
  558.    Case "ASCII"
  559.       GetF ASCII S6
  560.    EndC
  561.    Case "Kermit"
  562.       GetF Kermit S6
  563.    EndC
  564. EndS
  565. Retu
  566.  
  567. LogOut:
  568. Tran "!Are you sure you want to LOG OUT ? <Y/N> "
  569. If Conn
  570. Else
  571.    GoTo EndOfComm
  572. EndI
  573. RGet S6 1 30
  574. If Fail
  575.    GoTo TimeOut
  576. EndI
  577. Find S6 "Y"
  578. If Foun
  579.    Tran "! !"
  580.    Tran S5
  581.    Tran "Logging out. Disconnecting ..."
  582.    GoTo EndOfComm
  583. EndI
  584. Retu
  585.  
  586. SysopMessage:
  587. Tran "! !Do you wish to leave a message ? <Y/N> "
  588. If Conn
  589. Else
  590.    GoTo EndOfComm
  591. EndI
  592. RGet S6 1 60
  593. If Fail
  594.    GoTo TimeOut
  595. EndI
  596. Find S6 "Y"
  597. If Foun
  598.    Tran "! !Enter your message below. Press Ctrl-Z when done.!"
  599.    Tran "You have five minutes!"
  600.    If Conn
  601.    Else
  602.       GoTo EndOfComm
  603.    EndI
  604.    Log Open "BBSMESG.TXT"
  605.    Wait "^Z" 540
  606.    Tran "!Message saved!"
  607.    Log Clos
  608. EndI
  609. Retu
  610.  
  611. TimeOut:
  612. Tran "^G! ! !Time Out has occurred. Disconnecting ..."
  613.  
  614. EndOfComm:
  615. Hang
  616. GoTo StartOfSession
  617.