home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / modem / commo552.zip / MOSTHOST.MAC < prev    next >
Text File  |  1993-10-14  |  28KB  |  807 lines

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