home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / modem / cs_mac08.zip / LOGON.MAC < prev    next >
Text File  |  1993-10-24  |  31KB  |  747 lines

  1.  
  2.  ┌────────────────────────────────┐
  3.  │  Chuck Seyboldt's COMMO Macro  │   CS-MAC08:LOGON.MAC
  4.  └────────────────────────────────┘
  5.   *
  6.   *  Contents:       Generic logon routine (:glr)
  7.   *                  Test for ACTION (and call to ACTION.MAC)
  8.   *                  Get NEWFILES list if %flag contains "n"
  9.   *                  Getting to mail door
  10.   *                  Rename .QWK packets
  11.   *                  Test for .REP
  12.   *
  13.   *  Called from:    TABLE.MAC
  14.   *
  15.   *  Control passes to:  ACTION.MAC,action    (if ACTION.%abbr exists)
  16.   *                      COMMO.MAC,aln        (multi-dialer routine)
  17.   *
  18.   *  The file you are reading does  *NOT*  require editing.
  19.   *
  20. ***  BBSID particulars need to be added to COMMO.FON.
  21.   *
  22.   *  This file contains a logon macro.
  23.   *  It is designed to get you quickest to the "Main BBS Command?"
  24.   *  prompt.  BBSware specific prompts are delivered from TABLE.MAC.
  25.   *  After logon, a MAILRUN is made.  If the Commo variable %BBSID is
  26.   *  empty, control passes back to COMMO.MAC.
  27.   *
  28.   *  This works for PCBoards, for the RBBS run by Jim Goodenough,
  29.   *  Directory Assistance  (1,707 823-9516), for Shad Muegge's
  30.   *  BABBLE BBS (1,707 538-1507), for Mark Turner's ESCape running
  31.   *  GAP software (1,714 698-9568), for Mike Martell's Wolf's Moon
  32.   *  running Spitfire (1,207 893-1335), for Jeff Oberlee's Charlies
  33.   *  Foxhole BBS running MAXIMUS-CBCS (1,517 323-3405), for
  34.   *  Wildcat! boards, and for Bob Mahoney's Exec-PC BBS.
  35.   *  Always adding more prompts to accomodate more BBS types.
  36.   *  In general, turn any BBS HOTKEY option to OFF.
  37.   *
  38.  ┌─────────────────────────────┐
  39.  │  Standard Online Responses  │  (For the Generic Logon Routine)
  40.  └─────────────────────────────┘
  41.   *  Responses to common logging-on prompts.
  42.   *   :name sends first plus last name with one carriage return.
  43.   *   :f&l sends "first name <CR>", delays, then sends "last name <CR>"
  44.   *   :handle sends your handle rather than your name
  45.   *  Notice that I have a different response to the "First name?"
  46.   *  prompt for the BBS called Directory Assistance.
  47.  
  48.  {:retu}
  49.          {comp debug}               ;check %debug
  50.          {ifco ,stamp}              ;if NUL, go on; else goto :stamp}
  51.          {retu}                     ;Handy label and function assignment
  52.  
  53.  {:stamp}{disp ,,,%_24h%:%_min%.%_sec% LOGON.MAC }
  54.          {retu}                     ;stamp for debugging
  55.  
  56.  {:name} {comp bbsid,dirasnt}
  57.          {ifco lof1}                ;If BBSid=DIRASNT, send TURBO login
  58.          {send ~%name%|}            ; otherwise, just send name.
  59.          {retu}
  60.  {:lof1} {send %name %_pas !main|}
  61.          {alar 1} {retu}
  62.  
  63.  {:f&l}  {inst %name, }             ;find "space" in name
  64.          {setv pos,%_pos} {decr pos}
  65.          {subs first,1,%pos,%name}
  66.          {leng %name} {incr pos,2}
  67.          {subs last,%pos,%_len,%name}
  68.          {send ~%first|~~~~~%last|} ;Send first and last name 2.5 sec apart
  69.          {setv first}               ;reset variables
  70.          {setv last}
  71.          {retu}
  72.  
  73.  {:handle}
  74.          {send %handle|}     {goto retu} ;Send %handle
  75.  
  76.  {:lov}  {send ~%v_ph%|}     {goto retu} ;Voice Phone Number verification
  77.  {:lod}  {send ~%d_ph%|}     {goto retu} ;Data  Phone Number verification
  78.  {:lob}  {send ~%b_day%|}    {goto retu} ;Birthday verification
  79.  {:loq}  {send ~~%grafix%|}  {goto retu} ;choose ANSI colors  "Y/n"
  80.  {:_}    {send ~ }           {goto retu} ;this is how to send "SpaceBar"
  81.  {:|}    {send ~|}           {goto retu}
  82.  {:_|}   {send ~ |}          {goto retu}
  83.  {:c|}   {send ~c|}          {goto retu}
  84.  {:g|}   {send ~g|}          {goto retu}
  85.  {:n}    {send ~n}           {goto retu}
  86.  {:n|}   {send ~n|}          {goto retu}
  87.  {:q}    {send ~q}           {goto retu}
  88.  {:q|}   {send ~q|}          {goto retu}
  89.  {:s|}   {send ~s|}          {goto retu}
  90.  {:y}    {send ~y}           {goto retu}
  91.  {:y|}   {send ~y|}          {goto retu}
  92.  {:z|}   {send ~z|}          {goto retu}
  93.  {:0|}   {send ~0|}          {goto retu}
  94.  {:loe}  {send ~~^[^[}       {goto retu} ;this is sending two "Esc" presses
  95.  {:pas|} {send %_pas|}       {goto retu} ;this sends your password
  96.  {:mprot}{send %mprot}       {goto retu} ;this sends your mail fetching protocol
  97.  
  98.  {:no}   {send ~%no}         {goto ndl}
  99.  {:c_x}  {send ~^x~^x^x^x^x^x^x} {goto ndl}
  100.  
  101.  ┌─────────────────────────┐
  102.  │  Generic Logon Routine  │
  103.  └─────────────────────────┘
  104.   *  This logon macro works for times you DON'T want to
  105.   *  make a mail run.  It is designed to get you quickest to the
  106.   *  "Main BBS Command?" prompt.
  107.   *
  108.   *  It is necessary that this routine be reached via TABLE.MAC
  109.   *  since several BBS prompts are set there.
  110.  
  111.  {:glr}
  112.           disp ,,,Logging on Now^m^j^j
  113.           spdc n                    ;Blind display "for the bold"
  114.  
  115.          {comp bb,maj}
  116.          {ifco ,no_jump}
  117.          {send ~|}
  118.          {paus 2}
  119.          {send n|}
  120.  
  121.  {:no_jump}
  122.  
  123.          {sete-p0 esc}              ;point to ESCape routine
  124.          {setv nodl} {setv count}   ;set some working variables
  125.  
  126.          {comp debug}{ifco db_1}    ;using %debug variable to open
  127.          {capm raw}                 ; a capture file to facilitate
  128.          {setv capture,on}          ; troubleshooting when necessary
  129.          {capt y}    {goto db_2}
  130.  
  131.  {:db_1} {capt n}                   ;turnoff capture if open
  132.  {:db_2} {setl 60,bye,20,|}
  133.          {push}                     ;push + pops ≈ call
  134.          {ifca ,alm}                ;Skip routine if OFFline
  135.  
  136.          {golo alm,NO CARRIER^m}    ;Forces skip when carrier lost
  137.  
  138.          {golo loe, twice}          ;send Escape twice  "Front End"
  139.          {golo loe, (ESC)}          ;send Escape twice  "Binkley"
  140.          {golo loe,ESCape}          ;send Escape, another Binkley
  141.  
  142.          {golo _|,Login: }          ;NLBBS Front End
  143.          {golo n|,A>?}              ;just say 'no' RBBS prompt
  144.          {golo n|,change?}          ;PCBoard  "Language" prompt
  145.  
  146.          {golo y|, [Y,n]?}          ;MAXIMUS BBS "name?" confirmation
  147.          {golo y|,orrect?}          ;send 'y' when caller ID is asked
  148.          {golo onl,mmand?}          ;Logged on via "quick" RBBS logon
  149.  
  150.          {golo %gra_pmt}            ;send graphics instructions "TABLE.MAC"
  151.          {golo %nam_pmt}            ;send name "Prompt from TABLE.MAC"
  152.          {golo handle,User-ID:}     ;send %handle for Major BBS
  153.                                     ; %nam_pmt in TABLE.MAC is 'name,"new":'
  154.  
  155.          {look Password}            ;Logon macro now has two "lookfors"
  156.          {pops}                     ; Why?  To accomodate more golooks.
  157.          {paus 1}
  158.          {comp debug,y} {ifco-c stamp}
  159.          {call pas|}                ;send password
  160.  
  161.          {push}
  162.          {ifca ,alm}                ;Skip routine if OFFline
  163.  
  164.          {golo %bypass1}            ;These BBSware specific 'pause-
  165.          {golo %bypass2}            ;  avoiding-responses' are set in
  166.          {golo %bypass3}            ;  TABLE.MAC
  167.  
  168.          {golo |,to Continue}       ;just say 'no' to Continue
  169.          {golo n|,[y/n]?}           ;just say 'no' to "Y/n"
  170.  
  171.          {golo n|,More?}            ;just say 'no' to "More?"
  172.          {golo n|,=yes?}            ;just say 'no' to "mail scan"
  173.          {golo n|,N)?}              ;just say 'no' RBBS prompt
  174.  
  175.          {golo lod,TA ph}           ;More Wildcat! prompts <sigh>
  176.          {golo n|,menu? [}          ;No to Wildcat! bulletin menu
  177.          {golo c|,se- [C]}          ;[C]ontinue to -pause- prompt
  178.  
  179.          {golo pas|,Wrong}          ;resend password if necessary
  180.          {golo lob,DD-YY]}          ;Typical Date of Birth Prompt
  181.          {golo |,-on normally ...}  ;Charlie's Foxhole front end
  182.  
  183.          {look %bbs_pmt}            ;Generic Logon Complete
  184.  {:onl}  {spdc y}    {pops}         ;All set.  Logged-ON.
  185.          {comp debug,y} {ifco-c stamp}
  186.  
  187.  ┌─────────────────────────┐
  188.  │  Call ACTION Processor  │
  189.  └─────────────────────────┘
  190.  
  191.  {ifex %_hom%action.%abbr%,,noact}             ;CALL "ACTION processor"
  192.          {alar 1} {paus 1} {disp ,,,^j^j}
  193.          {disp ,18,1E,▌ 'S' to skip ACTION  ■  Any other key continues ▐}
  194.          {disp ,,,^m}
  195.          {setg 15,doact,n}                     ;if response is <CR>, do!
  196.          {gets-h resp,1,doact}                 ;using Commo for timed branch
  197.          {comp resp,s} {ifco noact}            ;15 second delay, default=do!
  198. {:doact} {macl action.mac,action}              ;ACTION.MAC Returns to :noact
  199.  
  200.  ┌─────────────────────────┐
  201.  │  MailRun Routine Start  │
  202.  └─────────────────────────┘
  203.  ┌────────────────────────────────────────────┐
  204.  │  "flagged" events may be called from here  │
  205.  └────────────────────────────────────────────┘
  206.   *  A %flag% variable is used to call for NEWFILE scans.
  207.   *  You should set the %flag variable in COMMO.FON
  208.   *  Setting .... {flag,n} ... "n" runs :NEWFILES,
  209.   *
  210.   *  This facility is setup for easy expansion.
  211.  
  212.  {:noact}{ifca ,alm}                           ;If Offline, quit here
  213.          {comp bbsid}                          ;Check %bbsid variable
  214.          {ifco esc}                            ;If empty, quit macro here
  215.          {push}
  216.          {inst %flag,n} {ifco newfiles}        ;otherwise, run %flag
  217.          {pops}                                ; function(s)
  218.  
  219.  ┌───────────────────┐
  220.  │  MailRun Routine  │
  221.  └───────────────────┘
  222.   *  Checking for a .REP file.  If a REP exists, you are offered
  223.   *  the option to only upload those replies.  But, the default action
  224.   *  is to get a QWK.  This way, unattended sessions fetch a .QWK
  225.   *  Or, by setting the variable %skip to "nl", you can skip the
  226.   *  attempt to download mail from the "NLBBS".
  227.  
  228.          {comp skip,%abbr} {ifco n_d}          ;"skip" flags
  229.          {comp skip,y}     {ifco n_d}
  230.          {ifex %repdr\%bbsid.%rep,ask,d_l}     ;GOTO mailrun routines
  231.  {:ask}  {alar 1} {paus 1} {disp ,,,^j^j}
  232.          {disp ,18,1E,▌ (C)ontinue mail d/l NOW ■ 'S' to skip d/l ▐}
  233.          {disp ,,,^m}
  234.          {setg 15,d_l,n}{gets-h resp,1,d_l}    ;using Commo for timed branch
  235.          {comp resp,c} {ifco d_l}              ;15 second delay, default=d/l
  236.          {comp resp, } {ifco d_l}
  237.          {comp resp,s} {ifco n_d}
  238.  {:n_d}  {setv nodl,y}                         ;set flag to skip mail d/l
  239.          {ifex %repdr\%bbsid.%rep,,byz}        ;if no .rep, Goodbye
  240.  
  241.  ┌───────────────────────────────┐
  242.  │  Get to the Mail Door Prompt  │
  243.  └───────────────────────────────┘
  244.  
  245.  {:d_l}  {ifca ,retu}               ;return to COMMO.MAC if offline
  246.          {send ~~%dorno}
  247.          {setl 60,bye,30,%yes}
  248.          {golo byz,invalid}         ;for invalid door selection
  249.          {golo byz,%bbs_pmt}        ;if unable to enter door
  250.          {push}
  251.          {golo |,inue>}             ;for Jimmer  Startup
  252.          {golo |,inue:}             ;for JetMail Startup
  253.          {golo |,inue?}             ;for MarkMail Startup
  254.          {golo |,[ENTER]}           ;for JCQwk Startup
  255.          {golo y|,inue...}          ;for QM4 prompt
  256.          {golo ndl,sorry,}          ;for T.A.G. unable to enter door
  257.          {look %md_pmt}             ;from TABLE.MAC prompt table
  258.          {comp debug,y} {ifco-c stamp}
  259.  
  260.  ┌─────────────────┐
  261.  │  Upload a .REP  │
  262.  └─────────────────┘
  263.   *  If a .REP exists, it is sent before any attempt is made to download.
  264.  
  265.  {:qul}  {pops}
  266.          {ifca ,retu}
  267.          {ifex %repdr\%bbsid.%rep,,nup}
  268.          {send ~~%up}
  269.          {setl 30,bye,,}
  270.          {call ulrep-%mprot}        ;%mprot selected in CS-MACxx.CFG
  271.          {ifca ,bya}
  272.          {setl 60,bye,15,|}
  273.          {push}
  274.          {golo |,inue?}             ;for MarkMail
  275.          {golo |,[ENTER]}           ;for JCQwk
  276.          {golo y|,inue...}          ;for QM4 prompt
  277.          {look %md_pmt}
  278.          {comp debug,y} {ifco-c stamp}
  279.  
  280.  ┌───────────────────┐
  281.  │  Download a .QWK  │
  282.  └───────────────────┘
  283.   *  The ":nup" section would be skipped if you decided to skip .QWK
  284.   *  downloading in the "Mailrun Routine Start, :ask" section.
  285.  
  286.  {:nup}  {pops}
  287.          {comp nodl,y} {ifco ,mdn}  ;Skip d/l if %nodl=y
  288.          {comp mail,dcq} {ifco mt_2};These maildoors need to quit
  289.          {comp mail,zns} {ifco mt_2}; to BBS before Goodbye
  290.          {goto byz}
  291.  {:mdn}  {send ~~~%dn}              ;Otherwise, scan for messages
  292.          {push}
  293.          {setl 100,bye,45,%yes}
  294.          {golo p_flg,extracting personal mail}  ;ZIPNEWS personal mail
  295.          {golo ndl,%mt_qwk}         ;eMpTy .QWK message "from TABLE.MAC"
  296.          {golo %md_brnch}           ;Branch, refer to MAILware TABLE.MAC
  297.  
  298.          {golo n,[N T Q]?}          ;LAKOTA Download menu (new messages)
  299.          {golo y,[A S Y Q]?}        ;LAKOTA Conference menu (Your queue)
  300.          {golo mprot,[X Y Z Q]?}    ;LAKOTA Protocol menu (use %mprot)
  301.  
  302.          {look Message Count}
  303.          {goto qdl}
  304.  
  305.  {:p_flg}{setv pmail,y} {retu}      ;Causes "P" display in Autopilot Mode
  306.                                     ;Cleared on Alt-C or on Alt-A "No" response
  307.  ┌──────────────────┐
  308.  │  Count Messages  │
  309.  └──────────────────┘
  310.   *  It is possible to add counting routines specific to any MAILware.
  311.   *  Use the variable %md_branch defined in TABLE.MAC to choose the
  312.   *  appropriate message counting routine.
  313.   *
  314.   *  This section will skip the RENQWK and any attempt to download if
  315.   *  the maildoor scans less than 30 messages for your .QWK packet.
  316.  
  317.  {:c_mm2}
  318.          {setg ,,l,^m}              ;MarkMail2 message counting
  319.          {gets count,15}            ;get total message count   w/ANSI
  320.          {subs count,-4,4,%count}   ;take last 4 characters  total
  321.          {look sages: }             ;MM2 personal message count
  322.          {gets person,15}           ;get personal message count  w/ANSI
  323.          {subs person,-4,4,%person} ;take last 4 characters  personal
  324.          {golo ndl,%mt_qwk}         ;eMpTy .QWK message "from TABLE.MAC"
  325.          {look %xfer_pmt}
  326.          {comp person,1}            ;check for personal messages
  327.          {ifco-GE qdl}              ; if any, do download ... but ...
  328.          {comp count,30}            ;if less than 30 total messages,
  329.          {ifco-L no,qdl}            ; then skip download
  330.  
  331.  {:c_qm2}
  332.          {setg ,,l,^m}              ;Qmail2 message counting
  333.          {gets count,17}            ;get total message count
  334.          {subs count,-4,4,%count}   ;take last 4 characters  total
  335.          {look gs Found....}        ;QM2 personal message count
  336.          {gets person,17}           ;get personal message count
  337.          {subs person,-4,4,%person} ;take last 4 characters  personal
  338.          {golo ndl,%mt_qwk}         ;eMpTy .QWK message "from TABLE.MAC"
  339.          {look %xfer_pmt}
  340.          {comp person,1}            ;check for personal messages
  341.          {ifco-GE qdl}              ; if any, do download ... but ...
  342.          {comp count,30}            ;if less than 30 total messages,
  343.          {ifco-L no,qdl}            ; then skip download
  344.  
  345.  {:c_qm4}
  346.          {setg ,,l,^m}              ;Qmail4 message counting
  347.          {gets count,17}            ;get total message count
  348.          {subs count,-4,4,%count}   ;take last 4 characters  total
  349.          {look Found.....}          ;QM4 personal message count
  350.          {gets person,17}           ;get personal message count
  351.          {subs person,-4,4,%person} ;take last 4 characters  personal
  352.          {golo ndl,%mt_qwk}         ;eMpTy .QWK message "from TABLE.MAC"
  353.          {look %xfer_pmt}
  354.          {comp person,1}            ;check for personal messages
  355.          {ifco-GE qdl}              ; if any, do download ... but ...
  356.          {comp count,30}            ;if less than 30 total messages,
  357.          {ifco-L no,qdl}            ; then skip download
  358.  
  359.  {:c_coq}
  360.          {setg ,,l,^m}              ;Message counting
  361.          {gets count,74}            ;for Charlie's Offline Reader
  362.          {subs count,-3,3,%count}   ;take last 3 characters  total
  363.          {golo ndl,%mt_qwk}         ;eMpTy .QWK message "from TABLE.MAC"
  364.          {look %xfer_pmt}
  365.          {comp count,25}
  366.          {ifco-L no,qdl}
  367.  
  368.  {:c_roz}
  369.          {setg ,,l,^m}              ;Rosemail message counting
  370.          {gets count,4}             ;get total message count
  371.          {subs count,-4,4,%count}   ;take last 4 characters  total
  372.          {look you     :}           ;Rosemail personal message count
  373.          {gets person,4}            ;get personal message count
  374.          {subs person,-4,4,%person} ;take last 4 characters  personal
  375.          {golo ndl,%mt_qwk}         ;eMpTy .QWK message "from TABLE.MAC"
  376.          {look %xfer_pmt}
  377.          {comp person,1}            ;check for personal messages
  378.          {ifco-GE qdl}              ; if any, do download ... but ...
  379.          {comp count,30}            ;if less than 30 total messages,
  380.          {ifco-L no,qdl}            ; then skip download
  381.  
  382.  {:c_zns}
  383.          {setg ,,l,^m}              ;Message counting for
  384.          {gets count,9}             ;Jack Kilday's ZIPNews door
  385.          {subs count,-3,3,%count}
  386.          {golo ndl,%mt_qwk}         ;ZIPNEWS "empty" occurs after count
  387.          {look %xfer_pmt}
  388.          {comp pmail,y}             ;Check if Personal Mail flag is set
  389.          {ifco qdl}                 ;Take a packet with personal mail
  390.          {comp count,30}
  391.          {ifco-L no,qdl}
  392.  
  393.  {:c_mmj}
  394.          {setg ,,l,^m}              ;Message counting for
  395.          {gets count,5}             ;MajorBBS QWK mail facility
  396.          {look %xfer_pmt}
  397.          {inst count,[}
  398.          {setv pos,%_pos}  {decr pos}
  399.          {subs count,1,%pos,%count}
  400.          {comp count,30}
  401.          {ifco-L no,qdl}
  402.  
  403.  {:c_p15}
  404.          {setg ,,l,^m}              ;Message counting for
  405.          {gets count,5}             ;PCBoard 15.0 built-in QWK mail facility
  406.          {look %xfer_pmt}
  407.          {comp count,30}
  408.          {ifco-L c_x,qdl}
  409.  
  410.  {:c_cam}
  411.          {setg ,,l,^m}              ;Cam-Mail message counting
  412.          {gets person,15}           ;get personal message count   w/ANSI
  413.          {subs person,-4,4,%person} ;take last 4 characters  total
  414.          {look .......}             ;CamMail total message count
  415.          {gets count,15}            ;get total message count  w/ANSI
  416.          {subs count,-4,4,%count}   ;take last 4 characters total
  417.          {golo ndl,%mt_qwk}         ;eMpTy .QWK message "from TABLE.MAC"
  418.          {look %xfer_pmt}
  419.          {comp person,1}            ;check for personal messages
  420.          {ifco-GE qdl}              ; if any, do download ... but ...
  421.          {comp count,30}            ;if less than 30 total messages,
  422.          {ifco-L no,qdl}            ; then skip download
  423.  
  424.  ┌────────────────────────────┐
  425.  │  .QWK rename and Download  │
  426.  └────────────────────────────┘
  427.   *  Renaming is much faster with one call to a batch file than several
  428.   *  COMMO calls to command.com.  Passing these variables from COMMO.MAC
  429.   *  to renqwk.bat.  %1 = %qwkdr : %2 = %bbsid : %3 = %abbr  %4 = %qwk
  430.   *
  431. *┌---------------  renqwk.bat  -┐    <--  cut here  --
  432. *|  @echo off                   |
  433. *|  ctty nul                    |
  434. *|                              |
  435. *|  del %1\%3__5.%4             |
  436. *|  ren %1\%3__4.%4  %3__5.%4   |
  437. *|  ren %1\%3__3.%4  %3__4.%4   |
  438. *|  ren %1\%3__2.%4  %3__3.%4   |
  439. *|  ren %1\%3__1.%4  %3__2.%4   |
  440. *|  ren %1\%2.%4     %3__1.%4   |
  441. *|                              |
  442. *|  ctty con                    |
  443. *└------------------------------┘    <--  cut here  --
  444.   *
  445.   *  An option to the BAT file renaming method is to do renaming
  446.   *  with a macro.  Several macro methods are later in this file.
  447.   *  You choose which method to use by presence or absence of renqwk.bat
  448.   *  in your Commo home directory and by choice of %qrdr and %znr
  449.   *  variables in your CS-MACxx.CFG file.
  450.   *
  451.   *  renqwk.bat present in Commo home directory  ...  use renqwk.bat
  452.   *  renqwk.bat absent from Commo home directory ...  use :renqwk macro
  453.  
  454.  {:qdl}  {pops}
  455.          {push}                          ;return here from :renqwk
  456.          {ifex %qwkdr\%bbsid.%qwk,,gonow};check for .QWK before rename
  457.          {ifex %_hom%renqwk.bat,,renqwk} ;use .BAT if it exists
  458.   *                                      ; otherwise use :renqwk routine
  459.   *                                      ; later in this Commo macro.
  460.   *
  461.          {exec-n %_hom%renqwk %qwkdr %bbsid %abbr %qwk} ;.QWKfile rename
  462.   *                                                     ; via renqwk.bat
  463.  {:gonow}{send ~~%yes}
  464.          {call dlqwk-%mprot}        ;download the .qwk
  465.          {ifca ,bya}
  466.  {:ndl}  {pops}
  467.          {setl 40,bye,15,|}
  468.          {comp mail,dcq}            ;DCQwk does not have a logoff
  469.          {ifco md_bbs}              ; from door facility.
  470.          {comp mail,mmj}            ;MajorBBS qwkmail does not have a logoff
  471.          {ifco md_bbs}              ; from door facility.
  472.          {comp mail,zns}            ;ZIPNEWS does not have a logoff
  473.          {ifco md_bbs}              ; from door facility.
  474.          {comp mail,lak}            ;LAKOTA does not have a logoff
  475.          {ifco md_bbs}              ; from door facility.
  476.          {goto notag}
  477.  
  478.  {:md_bbs}
  479.          {golo byz,%bbs_pmt}        ;any maildoor returning to BBS
  480.          {look %md_pmt}
  481.  {:mt_2} {send ~~%quit}
  482.  {:md_2} {setv quit,|}              ;Reset %quit
  483.          {setv mail}
  484.  
  485.  {:notag}{push}
  486.          {setl 60,bye,15,|}
  487.          {golo y|,inue...}          ;for QM4 "continue" prompt
  488.          {golo |,inue?}             ;for MarkMail
  489.          {golo |,[ENTER]}           ;for JCQwk
  490.          {golo byz,%bbs_pmt}        ;any maildoor returning to BBS
  491.          {look %md_pmt}             ;from MailDoor prompt table
  492.  
  493.  ┌───────────────────────────────────────────────────────────────────┐
  494.  │  Loop to TABLE.MAC and LOGON:noact for multiple doors in one call │
  495.  └───────────────────────────────────────────────────────────────────┘
  496.   *  The variable %bbs is set to NUL on the first pass through TABLE.MAC.
  497.   *  When TABLE.MAC,%mail is called with a NUL %bbs variable, TABLE.MAC
  498.   *   will return control to LOGON:noact
  499.  
  500.   *  To enter a second door on one call, set a variable, %door2, in
  501.   *  COMMO.FON.  You will set %mail, %dorno, and %bbsid in %door2.
  502.   *  ────┬─────               ────┬  ───┬──      ┬─────
  503.   *      └─────> Example; (door2,znr,zipnews|,nlbbs)
  504.  
  505.  {:byz}  {pops}
  506.          {comp door2}               ;is there a %door2 variable?
  507.          {ifco byz2}                ;if not, bye now!
  508.  
  509.          {send ~~%quit}             ;quit the mail door
  510.          {setl 60,bye,10,|}         ;send empty CR to clear "extra" commands
  511.          {look %bbs_pmt}
  512.          {inst door2,,}             ;find first "," in %door2
  513.          {setv pos,%_pos} {decr pos}
  514.          {subs mail,1,%pos,%door2}  ;portion before "," is %mail (MAILWare)
  515.          {incr pos,2}
  516.          {subs door2,%pos,80,%door2};portion after "," is %dorno and %bbsid
  517.          {inst door2,,}             ;find second "," in %door2
  518.          {setv pos,%_pos} {decr pos}
  519.          {subs dorno,1,%pos,%door2} ;portion before "," is %dorno entry command
  520.          {incr pos,2}
  521.          {subs bbsid,%pos,9,%door2} ;portion after "," is %bbsid
  522.          {setv door2}               ;clear second door variable
  523.          {setv nodl}                ;allow packet d/l from second door
  524.          {macl table.mac,qwk}       ;Will return to LOGON.MAC:noact
  525.  
  526.  ┌──────────────────────┐
  527.  │  LogOFF or Stay on?  │
  528.  └──────────────────────┘
  529.   *  Again a choice.  Default is to end the connection, but you may
  530.   *  stay ONLINE if you wish.  The macro is setup to open a capture
  531.   *  file if you choose to stay online.
  532.  
  533.  {:byz2} {paus 1} {alarm 1} {parm ,,,,0} {disp ,,,^j^j}
  534.          {disp ,18,1E,▌ 'G' to LogOFF NOW ■ SpaceBar to stay ON  ▐}
  535.          {disp ,,,^m}
  536.          {setg 10,bye,n} {gets-h resp,1,bye};using Commo for timed branch
  537.          {comp resp,g} {ifco bye}           ;10 second delay, default=bye
  538.          {comp resp, } {ifco sta}
  539.  
  540.  {:sta}  {clea}                     ;"Stay" routine
  541.          {setv bbsid}
  542.          {setv capture}             ;clear flag to avoid closing .CAP
  543.          {macl %_mac,chm}           ;commo.mac:chm opens capture file
  544.  
  545.  {:bye}  {ifca ,alm}                ;Skip routine if OFFline
  546.          {send %bye%%rs}
  547.          {setl 10,,,}
  548.          {push}
  549.  
  550.          {golo loe,<esc>}           ;stifle host delays
  551.          {golo y|, log off }
  552.          {golo y|, logoff? }
  553.  
  554.          {golo n|, comment }
  555.          {golo y|,Are you sure}     ;MajorBBS
  556.          {golo y|,Log Off?}         ;Virtual BBS
  557.  
  558.          {golo g|,[G] Goodbye...}   ;Babble
  559.          {golo |,?=help]?}          ;Charlie's Foxhole
  560.          {golo n,your choice -->}   ;EXEC-PC
  561.  
  562.          {golo |,to continue:}      ;Babble
  563.  
  564.          {look NO CARRIER^m^j}      ;comes from modem
  565.          {pops}
  566.  {:bya}  {hang y}
  567.          {setv lastcall,%bbsid}     ;save lastcall info
  568.          {setv bbsid} {setv dorno}  ;and recycle variables
  569.          {setv nodl}  {setv abbr}
  570.          {paus 3}
  571.          {macl %_mac,%m_call}       ;Dial next marked BBS
  572.  
  573.  {:esc}  {setv m_call}              ;if exit by pressing ESCape
  574.  {:alm}  {setv bbsid}               ; or if exit w/NO CARRIER,
  575.          {setv abbr}                ; leave this macro routine
  576.          {macl %_mac,%m_call}       ; return to "home" macro.
  577.  
  578.  ┌──────────────────────────────┐
  579.  │  .QWK file rename via macro  │
  580.  └──────────────────────────────┘
  581.   *  There are many ways to rename mail packets.  The variable %rdr
  582.   *  is used to branch to whatever rename method you prefer.  The
  583.   *  default method uses the date as part of the name and allows
  584.   *  up to 10 .qwk packets of the same date
  585.   *  (NL-1108.QWK --> NL-1108.QW0 --> NL-1108.QW1 --> etc.)
  586.   *
  587.   *  It would be very easy to change this progression to keep
  588.   *  the file extension ".qwk"
  589.   *  (NL-1108.QWK --> NL-11080.QWK --> NL-11081.QWK --> etc.)
  590.  
  591.  {:renqwk}
  592.          {comp rdr}     {ifco ,%rdr}
  593.  
  594.  {:qwk}  {ifex %qwkdr\%abbr%-%_mon%%_day.%qwk,m_dat}
  595.          {exec-n ren %qwkdr\%bbsid.%qwk %abbr%-%_mon%%_day.%qwk}
  596.          {retu}
  597.  {:m_dat}{setv count,0}
  598.  {:m_lop}{ifex %qwkdr\%abbr%-%_mon%%_day.qw%count,,r_mul}
  599.          {incr count}
  600.          {goto m_lop}
  601.  {:r_mul}{exec-n ren %qwkdr\%bbsid.%qwk %abbr%-%_mon%%_day.qw%count}
  602.          {retu}
  603.  
  604.   *  Rename method ala JABBER.
  605.   *
  606.  {:jbr}  {exec-n dir %qwkdr\%bbsid.* > %ramdr\temp}
  607.          {setv ext,0}
  608.          {rope %ramdr\temp,j_ren}
  609.  {:jbr_l}{read line}
  610.          {subs count,10,3,%line}
  611.          {comp count,%ext}
  612.          {ifco-ge ,jbr_l}
  613.          {setv ext,%count}
  614.          {goto jbr_l}
  615.  {:j_ren}{incr ext}
  616.          {leng %ext}
  617.          {comp %_len,3} {ifco n_pad}
  618.          {comp %_len,2} {ifco 1_pad}
  619.          {setv ext,0%ext}
  620.  {:1_pad}{setv ext,0%ext}
  621.  {:n_pad}{exec-n ren %qwkdr\%bbsid.%qwk %bbsid.%ext}
  622.          {retu}
  623.  
  624.   *  Rename method ala ZIPNEWS
  625.   *
  626.  {:znr}  {exec-n dir %znpak\%bbsid.z* > %ramdr\temp}
  627.          {setv ext,0}
  628.          {rope %ramdr\temp,z_ren}
  629.  {:znr_l}{read line}
  630.          {subs count,11,2,%line}
  631.          {comp count,%ext}
  632.          {ifco-ge ,znr_l}
  633.          {setv ext,%count}
  634.          {goto znr_l}
  635.  {:z_ren}{incr ext}
  636.          {leng %ext}
  637.          {comp %_len,2} {ifco no_pd}
  638.          {setv ext,0%ext}
  639.  {:no_pd}{exec-n ren %znpak\%bbsid.%qwk %bbsid.z%ext}
  640.          {retu}
  641.  
  642.  ┌──────────────────────────────────────┐
  643.  │  .QWK and .REP protocol subroutines  │
  644.  └──────────────────────────────────────┘
  645.   *  This arrangement provides a method to use a variety of mail
  646.   *  transfer protocols.
  647.  
  648.  ┌──────────┐
  649.  │  Zmodem  │
  650.  └──────────┘
  651.  {:ulrep-z}
  652.  {:ulrep-}                              ;default protocol is "Z"
  653.          {look ^xB01}                   ;Zmodem .REP Upload
  654.          {exec-dn %z_prog port %_por ha bo sz -m %repdr\%bbsid.%rep}
  655.          {ifer 1,,delrep}
  656.          {retu}
  657.  
  658.  {:dlqwk-z}
  659.  {:dlqwk-}                              ;default protocol is "Z"
  660.          {golo byz,%md_pmt}             ;maildoor packing error
  661.          {push}                         ;Zmodem .QWK Download
  662.          {golo g|,<G> to start}         ;for DCQwk/TAG
  663.          {golo |,or wait 10}            ;for Charlie's OffLineQWK
  664.          {look ^xB00}
  665.          {pops}
  666.          {exec-dn %z_prog port %_por ha bo rz -mr %qwkdr}
  667.          {retu}
  668.  
  669.  ┌──────────┐
  670.  │  Ymodem  │
  671.  └──────────┘
  672.  {:ulrep-y}                             ;Ymodem .REP Upload
  673.          {paus 5}
  674.          {symo-k %repdr\%bbsid.%rep}
  675.          {ifer 1,,delrep}               ;Goto delete .REP if trans OK
  676.          {retu}
  677.  
  678.  {:dlqwk-y}                             ;Ymodem .QWK Download
  679.          {paus 5}
  680.          {send g}                       ;for DCQwk/TAG
  681.          {rymo-y %qwkdr}                ;overwrite exiting files
  682.          {retu}
  683.  
  684.  ┌──────────┐
  685.  │  Xmodem  │
  686.  └──────────┘
  687.  {:ulrep-x}                             ;Xmodem .REP Upload
  688.          {paus 5}
  689.          {sxmo-k %repdr\%bbsid.%rep}
  690.          {ifer 1,,delrep}               ;Goto delete .REP if trans OK
  691.          {retu}
  692.  
  693.  {:dlqwk-x}                             ;Xmodem .QWK Download
  694.          {paus 5}
  695.          {send g}
  696.          {rxmo-y %qwkdr\%bbsid.%qwk}
  697.          {retu}
  698.  
  699.  ┌────────────────────┐
  700.  │  .REP File Delete  │
  701.  └────────────────────┘
  702.  {:delrep}
  703.          (golo retu,%failed_msg)        ;If "failed" message, do not delrep
  704.          (look %succeed_msg)            ;Lookfor "success" message before delrep
  705.          {exec-n del %repdr\%bbsid.%rep}
  706.          {retu}
  707.  
  708.  ┌────────────────────────────────────────┐
  709.  │  Functions called from %flag variable  │
  710.  └────────────────────────────────────────┘
  711.  
  712.  {:newfiles}
  713.          {setv strip,n}
  714.          {call stripflag}
  715.          {clea}
  716.          {send n s u|}
  717.          {capt y,%savedir\newfiles.%abbr}
  718.          {push}
  719.          {golo |,more?}
  720.          {look %bbs_pmt}
  721.          {pops}
  722.          {clea}
  723.          {capt n}
  724.          {send ~~|}
  725.          {retu}
  726.  
  727.  ┌──────────────────────────────────────────┐
  728.  │  Strip the acted-on function from %flag  │
  729.  └──────────────────────────────────────────┘
  730.   *  This subroutine strips the variable %flag of one character
  731.   *  so that each %flag function is run only once.
  732.  
  733.  {:stripflag}
  734.          {inst %flag,%strip}
  735.          {comp _pos,1}  {ifco fl2}
  736.          {setv pos,%_pos}               {decr pos}
  737.          {subs flag1,1,%pos,%flag}
  738.   {:fl2} {setv pos,%_pos}               {incr pos}
  739.          {subs flag2,%pos,36,%flag}
  740.          {setv flag,%flag1%%flag2}
  741.          {setv pos}
  742.          {setv strip}
  743.          {setv flag1}
  744.          {setv flag2}
  745.          {retu}
  746.  
  747.