home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1996 October / PCO_10.ISO / filesbbs / commo.arj / MOSTHOST.MAC < prev    next >
Encoding:
Text File  |  1996-08-24  |  24.5 KB  |  770 lines

  1.                         MOSTHOST.MAC (Regular version)
  2.                         by Shad Muegge and Fred Brucker
  3.  
  4. {:setup}                          * Set up MOSTHOST options
  5. -------------------------------------------------------------------------------
  6. -Configuration Items--------------Description----------------------------------
  7. -------------------------------------------------------------------------------
  8.  {LIGH Y}                         Modem signal lights
  9.  {SETV dospassword,PASSWORD}      Password to access the DOS menu
  10.  {SETV filedir,%_hom%MHFILE\}     Directory for file transfer files
  11.  {SETV datadir,%_hom%MHDATA\}     Directory for user data file
  12.  {SETV hotkeys,n}                 Hot keys (y/n)
  13.  {SETV inact_time,120}            Inactivity timer, seconds
  14.  {SETV ring_string,RING}          String sent from modem to indicate a ring
  15.  {SETV connect_string,CONNECT}    Result string for a successful connection
  16. -------------------------------------------------------------------------------
  17.  
  18.         {SETV pr_alarm,0}                   * Turn off protocol alarms
  19.         {SETG %inact_time,time_out}         * Set up GETString timer
  20.         {RTRA y,9,0}                        * Filter tabs from input
  21.         {CLEA}
  22.         {PARM ,,,A}
  23.         {SPOC y}
  24.         {LOCA y}
  25.         {SETE WF3}
  26.         {RETURN}
  27.  
  28. --------------------------------------------* General functions ---------------
  29. {:cls}                                      * Clear the screen
  30.         {SEND ^L}
  31.         {RETURN}
  32.  
  33. {:press_any_key}                            * Pause until a key is pressed
  34.         {SEND ^J^MPress Any Key:}
  35.         {GETS-H temp,1,PK}
  36. {:PK}   {setv temp}
  37.         {SEND ^J^M}
  38.         {RETURN}
  39.  
  40. {:dsp_file}                                 * Display a file
  41.         {IFEX %dump_file,,DF5}              * IN: %dump_file
  42.         {SETV count,0}
  43.         {ROPE %dump_file,DF3}
  44. {:DF1}  {READ dline}
  45.         {SEND ^M%dline^J^M}
  46.         {INCR count}
  47.         {COMP count,23}   {IFCO DF4}
  48.         {GOTO DF1}
  49. {:DF2}  {RCLOSE}
  50. {:DF3}  {SETV dline}
  51.         {SETV ch}
  52.         {SETV count}
  53.         {RETURN}
  54. {:DF4}  {SETV count,0}
  55.         {SEND ^MMore [Y],N,C: }
  56.         {CALL get_key}
  57.         {IFCO DF1}
  58.         {COMP ch,n}   {IFCO DF2}
  59.         {COMP ch,y}   {IFCO DF1}
  60.         {COMP ch,c}   {IFCO ,DF4}
  61.         {SETV count,26}
  62.         {GOTO DF1}
  63. {:DF5}  {SEND ^J^M^GError: File not found: %dump_file}
  64.         {CALL press_any_key}
  65.         {RETURN}
  66.  
  67. {:menu}                                     * Get menu selection
  68.         {SEND %prompt [%_tim]: }            * OUT: %ch
  69.         {CALL get_key}                      * %ch = ~, if user hit CR at prompt
  70.         {IFCO MN1}
  71.         {SEND ^J^M}
  72.         {COMP ch,*}   {IFCO time_out}
  73.         {GOTO MN2}
  74. {:MN1}  {SETV ch,~}
  75.         {SEND ^J^M}
  76. {:MN2}  {RETURN}
  77.  
  78. {:get_key}
  79.         {COMP hotkeys,y} {IFCO GK1}
  80.         {GETS ch,1}
  81.         {GOTO GK2}
  82. {:GK1}  {GETS-H ch,1}
  83. {:GK2}  {COMP ch}
  84.         {RETURN}
  85.  
  86. {:get_protocol}                             * Get protcol selection
  87.         {PAUS-T 2}
  88.         {CALL cls}                          * OUT: %protocol
  89.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  90.         {SEND │                    Protocols                      │^J^M}
  91.         {SEND └───────────────────────────────────────────────────┘^J^M}
  92.         {SEND                     [Y] Ymodem^J^M}
  93.         {SEND                     [G] Ymodem-G^J^M}
  94.         {SEND                     [X] Xmodem^J^M}
  95.         {SEND                     [Z] Zmodem^J^M}
  96.         {SEND                     [H] HS/Link^J^M^J^M}
  97.         {SETV prompt,Protocol:}
  98.         {CALL menu}
  99.         {COMP ch,~}   {IFCO PG2}
  100.         {COMP ch,z}   {IFCO PG1}
  101.         {COMP ch,y}   {IFCO PG1}
  102.         {COMP ch,g}   {IFCO PG1}
  103.         {COMP ch,x}   {IFCO PG1}
  104.         {COMP ch,h}   {IFCO ,PG2}
  105. {:PG1}  {SETV protocol,%ch}
  106. {:PG2}  {RETURN}
  107.  
  108. {:send_hslink}                              * HSLINK download subroutine
  109.         {SEND ^J^MStart your HS/Link download now.^J^M}
  110.         {CALL h_send}
  111.         {COMP %_err,0}
  112.         {RETURN}
  113.  
  114. {:send_zmodem}                              * ZMODEM download subroutine
  115.         {SEND ^J^MStart your Zmodem download now.^J^M}
  116.         {CALL z_send}
  117.         {COMP %_err,0}
  118.         {RETURN}
  119.  
  120. {:send_ymodem}                              * YMODEM download subroutine
  121.         {SEND ^J^MStart your Ymodem download now.^J^M}
  122.         {CALL yb_send}
  123.         {COMP %_err,0}
  124.         {RETURN}
  125.  
  126. {:send_xmodem}                              * XMODEM-1K download subroutine
  127.         {SEND ^J^MStart your Xmodem download now.^J^M}
  128.         {IFEX %pr_file,,SX1}
  129.         {CALL xk_send}
  130.         {COMP %_err,0}
  131. {:SX1}  {RETURN}
  132.  
  133. {:recv_hslink}                              * HSLINK upload subroutine
  134.         {SEND ^J^MStart your HS/Link upload now.^J^M}
  135.         {CALL h_recv}
  136.         {COMP %_err,0}
  137.         {RETURN}
  138.  
  139. {:recv_zmodem}                              * ZMODEM upload subroutine
  140.         {SEND ^J^MStart your Zmodem upload now.^J^M}
  141.         {CALL z_recv}
  142.         {COMP %_err,0}
  143.         {RETURN}
  144.  
  145. {:recv_ymodem}                              * YMODEM upload subroutine
  146.         {SEND ^J^MStart your Ymodem upload now.^J^M}
  147.         {CALL yb_recv}
  148.         {COMP %_err,0}
  149.         {RETURN}
  150.  
  151. {:recv_yg}                                  * YMODEM-G upload subroutine
  152.         {SEND ^J^MStart your Ymodem-G upload now.^J^M}
  153.         {CALL yg_recv}
  154.         {COMP %_err,0}
  155.         {RETURN}
  156.  
  157. {:recv_xmodem}                              * XMODEM-1K upload subroutine
  158.         {SEND ^J^MStart your Xmodem upload now.^J^M}
  159.         {CALL xc_recv}
  160.         {COMP %_err,0}
  161.         {RETURN}
  162.  
  163. {:transfer_file}                            * Transfer a file upload & download
  164.         {PUSH DL2}
  165.         {COMP proto,sz} {IFCO send_zmodem}  * IN: %proto
  166.         {COMP proto,sy} {IFCO send_ymodem}  *   s + %protocol for downloads
  167.         {COMP proto,sg} {IFCO send_ymodem}  *   r + %protocol for uploads
  168.         {COMP proto,sx} {IFCO send_xmodem}
  169.         {COMP proto,sh} {IFCO send_hslink}
  170.         {COMP proto,rz} {IFCO recv_zmodem}
  171.         {COMP proto,ry} {IFCO recv_ymodem}
  172.         {COMP proto,rg} {IFCO recv_yg}
  173.         {COMP proto,rx} {IFCO recv_xmodem}
  174.         {COMP proto,rh} {IFCO recv_hslink}
  175.         {SEND ^J^MInvalid protocol ^J^M}
  176.         {CALL press_any_key}
  177.         {COMP proto,sz}                     * Set a bad condition for return
  178. {:DL1}  {SETV proto}
  179.         {POPS}
  180.         {RETURN}
  181. {:DL2}  {PAUS 2}
  182.         {RETURN}
  183.  
  184. {:get_name}
  185.         {SEND ^J^J^MEnter your name: }      * Get a name from user
  186.         {GETS lname}                        * OUT: %lname
  187.         {COMP lname}                        * OUT: cond. flag set if null
  188.         {RETURN}
  189.  
  190. {:get_password}                             * Get a password
  191.         {GETS-P pass}
  192.         {RETURN}
  193.  
  194. {:time_out}                                 * Time out user
  195.         {POPS-C}                            * Clear the stack
  196.         {GOTO GBY}
  197.  
  198. {:write_user}                               * Update user record in user file
  199.         {ROPE %datadir%USER.MHS,WU3}
  200.         {WOPE %datadir%$$$TEMP.MHS}
  201. {:WU1}  {CALL read_rec}
  202.         {COMP login_name,%u_temp1}
  203.         {IFCO WU2}
  204.         {CALL write_rec}
  205.         {GOTO WU1}
  206. {:WU2}  {CALL user_temp}
  207.         {CALL write_rec}
  208.         {GOTO WU1}
  209. {:WU3}  {POPS}  ** pop read_rec return addr
  210.         {WCLO}
  211.         {EXEC-N del %datadir%USER.MHS}
  212.         {EXEC-N ren %datadir%$$$TEMP.MHS USER.MHS}
  213.         {SETV u_temp1}
  214.         {SETV u_temp2}
  215.         {SETV u_temp3}
  216.         {RETURN}
  217.  
  218. {:write_rec}                                * Write a user record
  219.         {WRIT %u_temp1}                     * IN: name
  220.         {WRIT %u_temp2}                     * IN: password
  221.         {WRIT %u_temp3}                     * IN: protocol
  222.         {RETURN}
  223.  
  224. {:read_user}                                * Read a user record
  225.         {IFEX %datadir%USER.MHS,,RU3}       * IN: %login_name
  226.         {ROPE %datadir%USER.MHS,RU2}
  227. {:RU1}  {CALL read_rec}
  228.         {COMP lname,%u_temp1}
  229.         {IFCO ,RU1}
  230.         {CALL temp_user}
  231.         {RCLO}
  232.         {GOTO RU4}
  233. {:RU2}  {POPS}
  234. {:RU3}  {SETV password}                     * Indicate not found
  235. {:RU4}  {SETV u_temp1}
  236.         {SETV u_temp2}
  237.         {SETV u_temp3}
  238.         {RETURN}
  239.  
  240. {:read_rec}                                 * Read a user record
  241.         {READ u_temp1}                      * OUT: name
  242.         {READ u_temp2}                      * OUT: password
  243.         {READ u_temp3}                      * OUT: protocol
  244.         {RETURN}
  245.  
  246. {:user_temp}                                * User data to temp
  247.         {SETV u_temp1,%login_name}
  248.         {SETV u_temp2,%password}
  249.         {SETV u_temp3,%protocol}
  250.         {RETURN}
  251.  
  252. {:temp_user}                                * Temp to user data
  253.         {SETV login_name,%u_temp1}
  254.         {SETV password,%u_temp2}
  255.         {SETV protocol,%u_temp3}
  256.         {RETURN}
  257.  
  258. --------------------------------------------* Login functions -----------------
  259.  
  260. {:new_user}                                 * Get new user information
  261.         {SETV login_name,%lname}
  262.         {SETV tries,0}
  263. {:NU1}  {INCR tries}
  264.         {COMP tries,3}  {IFCO-G NU4}
  265.         {SEND ^J^MEnter a password: }
  266.         {CALL get_password}
  267.         {COMP pass} {IFCO NU1}
  268.         {SETV password,%pass}
  269.         {SEND ^J^MRe-enter for verification: }
  270.         {SETV tries,0}
  271. {:NU2}  {INCR tries}
  272.         {COMP tries,3}  {IFCO-G NU4}
  273.         {CALL get_password}
  274.         {COMP password,%pass} {IFCO ,NU1}
  275.  
  276. {:NU3}  {SETV new_start,1}
  277.         {CALL get_protocol}
  278.         {SEND ^J^MSaving user information.}
  279.         {WOPE-A %datadir%USER.MHS}
  280.         {CALL user_temp}
  281.         {CALL write_rec}
  282.         {WCLO}
  283.         {SETV SUCCESS,true}
  284. {:NU4}  {SETV tries}
  285.         {SETV lname}
  286.         {SETV pass}
  287.         {RETURN}
  288.  
  289. {:login_user}                               * Login user
  290.         {SETV SUCCESS}                      * OUT: %SUCCESS
  291.         {SETV tries,0}                      * OUT: %login_name
  292. {:LU0}  {INCR tries}                        * OUT: %password
  293.         {COMP tries,3}  {IFCO-G LU5}        * OUT: %new_start
  294.         {CALL get_name}                     * OUT: %protocol
  295.         {IFCO LU0}
  296.         {CALL read_user}
  297.         {COMP password}  ** null password means not found
  298.         {IFCO ,LU3}
  299.         {SEND ^J^J^MName not found in user list.^J^M}
  300.         {SEND Is "%lname" correct? (Y/N)}
  301. {:LU1}  {CALL get_key}
  302.         {IFCO LU1}
  303.         {COMP ch,y} {IFCO ,LU0}
  304.         {SEND ^J^J^MLogin as a new user? (Y/N)}
  305. {:LU2}  {CALL get_key}
  306.         {IFCO LU2}
  307.         {COMP ch,n} {IFCO GBY,new_user}
  308.  
  309. {:LU3}  {SETV tries,0}
  310. {:LU4}  {INCR tries}
  311.         {COMP tries,3}  {IFCO-G LU5}
  312.         {SEND ^J^Mpassword: }
  313.         {CALL get_password}
  314.         {COMP password,%pass}
  315.         {IFCO ,LU4}
  316.         {SETV SUCCESS,true}
  317.  
  318. {:LU5}  {SETV tries}
  319.         {SETV lname}
  320.         {SETV pass}
  321.         {RETURN}
  322.  
  323. --------------------------------------------* Dos functions--------------------
  324.  
  325. {:change_dir}                               * Change Dir
  326.         {SEND ^J^MCD }
  327.         {GETS cd,70,CD1}
  328.         {EXEC-N CD %cd}
  329. {:CD1}  {SETV cd}
  330.         {RETURN}
  331.  
  332. {:do_dir}                                   * Directory
  333.         {CALL cls}
  334.         {SEND ^J^MDIR }
  335.         {GETS dir,70}
  336.         {EXEC-N DIR /-p %dir > %datadir%DIR.TMP}
  337.         {SETV dump_file,%datadir%DIR.TMP}
  338.         {CALL dsp_file}
  339.         {CALL press_any_key}
  340.         {SETV dir}
  341.         {RETURN}
  342.  
  343. {:type_file}                                * Type a file
  344.         {CALL cls}
  345.         {SEND ^J^MTYPE }
  346.         {GETS type,70,TF1}
  347.         {SEND ^J^M}
  348.         {SETV dump_file,%type}
  349.         {CALL dsp_file}
  350.         {CALL press_any_key}
  351. {:TF1}  {SETV type}
  352.         {RETURN}
  353.  
  354. {:erase_file}                               * Erase a file
  355.         {SEND ^J^M^J^M(CR to abort)}
  356.         {SEND ^J^MERASE }
  357.         {GETS erase,70,EF1}
  358.         {COMP erase,*.*}
  359.         {IFCO ,EF4}
  360.         {SEND ^J^M*.* not allowed!}
  361.         {CALL press_any_key}
  362.         {GOTO EF1}
  363. {:EF4}  {IFEX %erase,,EF2}
  364.         {SEND ^J^MErase %erase (Y/N): }
  365. {:EF3}  {CALL get_key}
  366.         {IFCO EF3}
  367.         {COMP ch,y} {IFCO ,erase_file}
  368.         {EXEC-N ERASE %erase > nul}
  369.         {GOTO EF1}
  370. {:EF2}  {SEND ^J^MFile not found.}
  371.         {GOTO erase_file}
  372. {:EF1}  {SETV erase}
  373.         {RETURN}
  374.  
  375. {:copy_file}                                * Copy a file
  376.         {SEND ^J^MCOPY }
  377.         {GETS copy,70,CF1}
  378.         {EXEC-N COPY %copy > nul}
  379. {:CF1}  {SETV copy}
  380.         {RETURN}
  381.  
  382. {:rename_file}                              * Rename a file
  383.         {SEND ^J^MREN }
  384.         {GETS ren,70,RF1}
  385.         {EXEC-N REN %ren > nul}
  386. {:RF1}  {SETV ren}
  387.         {RETURN}
  388.  
  389. {:exit_to_dos}                              * Exit to dos with DOORWAY.EXE
  390.         {COMP mspeed,local}
  391.         {IFCO EX1}
  392.         {EXEC-S DOORWAY PORT:%_pad:%_irq /M:600 /A:ON /V:D /O:T /S:* /C:DOS}
  393.         {GOTO EX2}
  394. {:EX1}  {SHELL-S}
  395. {:EX2}  {RETURN}
  396.  
  397. {:dos_download}                             * Download a file
  398.         {SETV proto}                        * IN: %protocol
  399.         {COMP protocol,}
  400.         {IFCO ,DD1}
  401.         {CALL get_protocol}
  402. {:DD1}  {SEND ^J^MFile: }
  403.         {GETS pr_file,70,DD2}
  404.         {SETV proto,s%protocol}
  405.         {SETV save_filedir,%filedir}
  406.         {SETV filedir}
  407.         {CALL transfer_file}
  408.         {CALL cls}
  409.         {SETV filedir,%save_filedir}
  410.         {SETV save_filedir}
  411.         {IFCO DD2}
  412.         {SEND ^J^MUnsuccessful download}
  413.         {CALL press_any_key}
  414. {:DD2}  {SETV pr_file}
  415.         {RETURN}
  416.  
  417. {:dos_upload}                               * Upload a file
  418.         {SETV proto}                        * IN: %protocol
  419.         {COMP protocol,}
  420.         {IFCO ,DU1}
  421.         {CALL get_protocol}
  422. {:DU1}  {COMP protocol,x}
  423.         {IFCO ,DU2}
  424.         {SEND ^J^MFile: }
  425.         {GETS pr_file,70,DU3}
  426. {:DU2}  {SETV proto,r%protocol}
  427.         {SETV save_filedir,%filedir}
  428.         {SETV filedir}
  429.         {CALL transfer_file}
  430.         {CALL cls}
  431.         {SETV filedir,%save_filedir}
  432.         {SETV save_filedir}
  433.         {IFCO DU3}
  434.         {SEND ^J^MUnsuccessful upload}
  435.         {CALL press_any_key}
  436. {:DU3}  {SETV pr_file}
  437.         {RETURN}
  438.  
  439. {:log_drive}                                * Log a drive
  440.         {SEND ^J^MChange to which drive (A:, B:, C:, etc): }
  441.         {GETS log,2,LD2}
  442. {:LD1}  {SEND ^J^MChange to drive %log (Y/N)? }
  443.         {CALL get_key}
  444.         {IFCO LD1}
  445.         {COMP ch,n}  {IFCO LD2}
  446.         {COMP ch,y}  {IFCO ,LD1}
  447.         {EXEC-N %log}
  448. {:LD2}  {SETV log}
  449.         {RETURN}
  450.  
  451. {:dos_stuff}                                * Dos Menu
  452.         {SEND ^J^MDos password: }
  453.         {CALL get_password}
  454.         {COMP pass,%dospassword}
  455.         {IFCO ,DS3}
  456.         {SETV pr_down}                      * Use current directories
  457.         {SETV pr_up}
  458.         {PUSH}
  459. {:DS1}
  460.         {PAUS-T 2}
  461.         {CALL cls}
  462.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  463.         {SEND │                   DOS Commands                    │^J^M}
  464.         {SEND └───────────────────────────────────────────────────┘^J^M}
  465.         {SEND  [A] Log New Drive^J^M}
  466.         {SEND  [C] Change Dir       [U] Upload to current dir^J^M}
  467.         {SEND  [D] Directory        [V] Download from current dir^J^M}
  468.         {SEND  [E] Erase File^J^M}
  469.         {SEND  [K] Copy File        [Z] Run DOORWAY program (shell^J^M}
  470.         {SEND  [T] Type File            to DOS in local mode)^J^M}
  471.         {SEND  [R] Rename File^J^M^J^M}
  472.         {SETV prompt,DOS (CR to return)}
  473.         {CALL menu}
  474.  
  475.         {COMP ch,~}   {IFCO DS2}
  476.         {COMP ch,a}   {IFCO log_drive}
  477.         {COMP ch,c}   {IFCO change_dir}
  478.         {COMP ch,d}   {IFCO do_dir}
  479.         {COMP ch,e}   {IFCO erase_file}
  480.         {COMP ch,k}   {IFCO copy_file}
  481.         {COMP ch,r}   {IFCO rename_file}
  482.         {COMP ch,t}   {IFCO type_file}
  483.         {COMP ch,u}   {IFCO dos_upload}
  484.         {COMP ch,v}   {IFCO dos_download}
  485.         {COMP ch,z}   {IFCO exit_to_dos}
  486.  
  487.         {GOTO DS1}
  488. {:DS2}  {POPS}
  489. {:DS3}  {SETV pass}
  490.         {SETV prompt}
  491.         {RETURN}
  492.  
  493. --------------------------------------------* Xfer functions-------------------
  494.  
  495. {:dfiles}                                   * Download a file
  496.         {SETV proto}                        * IN/OUT: %protocol
  497.         {COMP protocol,}
  498.         {IFCO ,DX1}
  499.         {CALL get_protocol}
  500. {:DX1}  {SEND ^J^MFile: }
  501.         {GETS pr_file,70,DX2}
  502.         {SETV pr_file,%filedir%%pr_file}
  503.         {SETV proto,s%protocol}
  504.         {CALL transfer_file}
  505.         {CALL cls}
  506.         {IFCO DX2}
  507.         {SEND ^J^MUnsuccessful download}
  508.         {CALL press_any_key}
  509. {:DX2}  {SETV pr_file}
  510.         {RETURN}
  511.  
  512. {:ufiles}                                   * Upload a file
  513.         {SETV proto}                        * IN/OUT: %protocol
  514.         {SETV pr_file,%filedir}
  515.         {COMP protocol,}
  516.         {IFCO ,UF1}
  517.         {CALL get_protocol}
  518. {:UF1}  {COMP protocol,x}
  519.         {IFCO ,UF2}
  520.         {SEND ^J^MFile: }
  521.         {GETS dfiles,70,UF3}
  522.         {SETV pr_file,%pr_file%%dfiles}
  523.         {IFEX %pr_file,,UF2}
  524.         {SEND ^J^MFile already exists!^J^M}
  525.         {CALL Press_Any_Key}
  526.         {GOTO UF3}
  527. {:UF2}  {SETV proto,r%protocol}
  528.         {CALL transfer_file}
  529.         {CALL cls}
  530.         {IFCO UF3}
  531.         {SEND ^J^MUnsuccessful upload}
  532.         {CALL press_any_key}
  533. {:UF3}  {SETV pr_file}
  534.         {SETV dfiles}
  535.         {RETURN}
  536.  
  537. -------------------------------------------------------------------------------
  538.  
  539. {:chat}                                      * Chat w/word wrap
  540.         {BEEP} {BEEP} {BEEP}
  541.         {SETV chatc,3}
  542.         {SEND ^J^M^J^M(Type 'bye' to exit chat mode)^J^M}
  543.         {SEND ^J^M1> Hi %login_name, what's up?}
  544.         {SEND ^J^M2>}
  545. {:CT1}  {SETV chatl}
  546. {:CT2}  {SEND ^J^M%chatc> %chatl}
  547.         {INCR chatc}
  548.         {GETS-AH chatl,70}
  549.         {COMP chatl,bye}  {IFCO CT5}
  550.         {LENGTH %chatl}
  551.         {COMP %_len,69}  {IFCO-LE CT1}
  552.         {SETV x,71}
  553. {:CT3}  {DECR x}
  554.         {COMP x,50}  {IFCO-LE CT1}
  555.         {SUBS ch,%x,1,%chatl}
  556.         {COMP ch, }       {IFCO ,CT3}
  557.         {INCR x}
  558.         {SUBS chatl,%x,255,%chatl}
  559. {:CT4}  {COMP x,%_len}  {IFCO-G CT2}
  560.         {SEND ^H ^H}
  561.         {INCR x}
  562.         {GOTO CT4}
  563. {:CT5}  {RETURN}
  564.  
  565. -------------------------------------------------------------------------------
  566.  
  567. {:time_online}                              * Elapsed time
  568.         {SEND ^J^MTime online: %_elap^J^M}
  569.         {CALL Press_Any_Key}
  570.         {RETURN}
  571.  
  572. --------------------------------------------* User info------------------------
  573.  
  574. {:chg_name}                                 * Get new login name
  575.         {SEND ^J^M}                         * OUT: %lname
  576. {:CN1}  {CALL get_name}
  577.         {RETURN}
  578.  
  579. {:chg_password}                             * Get new password
  580.         {SEND ^J^M}                         * OUT: %pass
  581. {:CP1}  {SEND ^J^MNew password: }
  582.         {GETS pass,,CP1}
  583.         {RETURN}
  584.  
  585. {:chg_protocol}                             * Get new protocol
  586.         {CALL cls}                          * OUT: %protocol
  587.         {CALL get_protocol}
  588.         {RETURN}
  589.  
  590. {:save_user}                                * Save new information
  591.         {SEND ^J^MSaving}                   * IN: %lname,%pass,%protocol
  592.         {SETV login_name,%lname}            * OUT: %login_name,%password
  593.         {SETV password,%pass}               * OUT: %uprot
  594.         {SETV uprot,%protocol}
  595.         {CALL write_user}
  596.         {RETURN}
  597.  
  598. {:fil_dir}
  599.         {EXEC-N DIR %filedir%*.* > %datadir%DIR.TMP}
  600.         {SETV dump_file,%datadir%DIR.TMP}
  601.         {CALL cls}
  602.         {CALL dsp_file}
  603.         {CALL press_any_key}
  604.         {RETURN}
  605.  
  606. {:update_info}                              * User info menu
  607.         {SETV lname,%login_name}
  608.         {SETV pass,%password}
  609.         {SETV uprot,%protocol}
  610.         {PUSH}
  611. {:UI1}  {CALL cls}
  612.         {SEND ^J^M}
  613.         {SEND ^J^M1.  User name: %lname}
  614.         {SEND ^J^M2.   Password: %pass}
  615.         {SEND ^J^M3.   Protocol: %protocol}
  616.         {SEND ^J^M}
  617.         {SEND ^J^MCommand (CR to return) [%_tim]: }
  618.         {CALL get_key}
  619.         {IFCO UI2}
  620.  
  621.         {COMP ch,1}  {IFCO chg_name}
  622.         {COMP ch,2}  {IFCO chg_password}
  623.         {COMP ch,3}  {IFCO chg_protocol}
  624.         {GOTO UI1}
  625.  
  626. {:UI2}  {SEND ^J^MSave changes (Y/N)? }
  627.         {CALL get_key}
  628.         {IFCO UI3}
  629.         {COMP ch,n} {IFCO UI3}
  630.         {COMP ch,y} {IFCO ,UI2}
  631.         {CALL save_user}
  632. {:UI3}  {POPS}
  633.         {SETV ch}
  634.         {SETV lname}
  635.         {SETV pass}
  636.         {SETV protocol,%uprot}
  637.         {RETURN}
  638.  
  639. -------------------------------------------------------------------------------
  640.  
  641. {:main_menu}                                * Main menu
  642.         {SETV pr_down,%filedir}             * Protocol download path
  643.         {SETV pr_up,%filedir}               * Protocol upload path
  644.         {PUSH}
  645. {:MM1}
  646.         {PAUS-T 2}
  647.         {CALL cls}
  648.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  649.         {SEND │                    Main Menu                      │^J^M}
  650.         {SEND └───────────────────────────────────────────────────┘^J^M}
  651.         {SEND       [D] Download Files        [T] Time online^J^M}
  652.         {SEND       [U] Upload Files          [G] Goodbye^J^M}
  653.         {SEND       [F] File List             [S] DOS Menu^J^M}
  654.         {SEND       [C] Chat                  [I] User Info^J^M}
  655.         {SEND       [P] Protocol (%protocol)^J^M^J^M}
  656.         {SETV prompt,Main Menu}
  657.         {CALL menu}
  658.  
  659.         {COMP ch,c}   {IFCO chat}
  660.         {COMP ch,f}   {IFCO fil_dir}
  661.         {COMP ch,s}   {IFCO dos_stuff}
  662.         {COMP ch,g}   {IFCO MM3}
  663.         {COMP ch,t}   {IFCO time_online}
  664.         {COMP ch,i}   {IFCO update_info}
  665.         {COMP ch,d}   {IFCO dfiles}
  666.         {COMP ch,p}   {IFCO get_protocol}
  667.         {COMP ch,u}   {IFCO ufiles}
  668.         {GOTO MM1}
  669.  
  670. {:MM3}  {SEND ^J^MAre you sure (Y/N)? }
  671.         {CALL get_key}
  672.         {IFCO MM1}
  673.         {COMP ch,y}   {IFCO ,MM1}
  674.  
  675. {:MM2}  {POPS}
  676.         {RETURN}
  677.  
  678. --------------------------------------------* Waiting for a call funcs--------
  679.  
  680. {:user_edit}
  681.         {SETV ed,%datadir%USER.MHS}
  682.         {IFEX %ed,,UE1}
  683.         {EDIT %ed}
  684. {:UE1}  {GOTO wait_for_call}
  685.  
  686. {:view_scroll}
  687.         {SCROLL}
  688.         {GOTO wait_for_call}
  689.  
  690. {:shell_dos}
  691.         {SHELL-S}
  692.         {GOTO wait_for_call}
  693.  
  694. {:wait_for_call}
  695.         {SPOC n}
  696.         {CLEAR}
  697.         {DISP 1,29,4E,  ^(COMMO^) HOST MODE  }
  698.  
  699.         {DISP 4,29,0E,The Host with the Most}
  700.         {DISP 8,29,0E,  1 - Login locally}
  701.         {DISP 9,29,0E,  2 - Edit User File}
  702.         {DISP 10,29,0E,  3 - View Scrollback}
  703.         {DISP 11,29,0E,  4 - Shell to DOS}
  704.         {DISP 12,29,0E,  Q - Quit}
  705.  
  706.         {DISP 22,1,0E,  Last user: %login_name (%mspeed)}
  707.  
  708.         {DISP 24,29,4e, Waiting for a Call }
  709.         {DISP 20,1,,                               }
  710.         {DISP 20,1,0E,  Command: }
  711.         {SETG 0,,l}
  712. {:WF1}  {GETS mring,10,WF1}
  713.         {SETG %inact_time,time_out}
  714.         {DISP 24,29,07,                    }
  715.         {COMP mring,1}              {IFCO WF2}
  716.         {COMP mring,2}              {IFCO user_edit}
  717.         {COMP mring,3}              {IFCO view_scroll}
  718.         {COMP mring,4}              {IFCO shell_dos}
  719.         {COMP mring,q}              {IFCO WF3}
  720.         {COMP mring,%ring_string}   {IFCO ,Wait_for_call}
  721.  
  722.         {SPOC y}
  723.         {DISP 24,29}
  724.         {SEND ~ATA^M~}
  725.  
  726.         {SETL 45,wait_for_call}
  727.         {DISP 20,1,7,  Waiting for connect: }
  728.         {LOOK %connect_string}
  729.         {SETV mspeed,%_spe}
  730.         {PAUS 1}
  731.         {RETURN}
  732.  
  733. {:WF2}  {SETV mspeed,LOCAL}
  734.         {LOCA y}
  735.         {SPOC n}
  736.         {RETURN}
  737.  
  738. {:WF3}  {CLEAR}
  739.         {SETV-R _mh_mark}                   * Clean up variables
  740.         {LOCA n}
  741.         {RTRA-i n}
  742.         {UNLOad} {}
  743.  
  744. --------------------------------------------* Main BBS loop ------------------
  745.  
  746. {:BBS}
  747.         {SETV _mh_mark}                     * Set variable marker
  748.         {SETV _mh_mark,mark}
  749. {:BB1}  {CALL setup}
  750.         {CALL Wait_For_Call}
  751.         {CALL cls}
  752.         {SEND ^J^M                                  HOST MODE^J^M^J}
  753.         {SEND                        Written in ^(COMMO^) macro language^J^M^J^J}
  754.         {CALL login_user}
  755.         {COMP success,TRUE}
  756.         {IFCO ,GBY}
  757.         {ELAP}
  758.         {CALL main_menu}
  759. {:GBY}
  760.         {SEND ^J^M^JThanks for calling...^J^M}
  761.         {HANG y}
  762.         {COMP success,TRUE}
  763.         {IFCO ,GB1}
  764.         {SEND Saving}
  765.         {CALL write_user}
  766. {:GB1}  {SETV success}
  767.         {GOTO BB1}
  768.  
  769.                                 - end -
  770.