home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
modem
/
cs_mac08.zip
/
LOGON.MAC
< prev
next >
Wrap
Text File
|
1993-10-24
|
31KB
|
747 lines
┌────────────────────────────────┐
│ Chuck Seyboldt's COMMO Macro │ CS-MAC08:LOGON.MAC
└────────────────────────────────┘
*
* Contents: Generic logon routine (:glr)
* Test for ACTION (and call to ACTION.MAC)
* Get NEWFILES list if %flag contains "n"
* Getting to mail door
* Rename .QWK packets
* Test for .REP
*
* Called from: TABLE.MAC
*
* Control passes to: ACTION.MAC,action (if ACTION.%abbr exists)
* COMMO.MAC,aln (multi-dialer routine)
*
* The file you are reading does *NOT* require editing.
*
*** BBSID particulars need to be added to COMMO.FON.
*
* This file contains a logon macro.
* It is designed to get you quickest to the "Main BBS Command?"
* prompt. BBSware specific prompts are delivered from TABLE.MAC.
* After logon, a MAILRUN is made. If the Commo variable %BBSID is
* empty, control passes back to COMMO.MAC.
*
* This works for PCBoards, for the RBBS run by Jim Goodenough,
* Directory Assistance (1,707 823-9516), for Shad Muegge's
* BABBLE BBS (1,707 538-1507), for Mark Turner's ESCape running
* GAP software (1,714 698-9568), for Mike Martell's Wolf's Moon
* running Spitfire (1,207 893-1335), for Jeff Oberlee's Charlies
* Foxhole BBS running MAXIMUS-CBCS (1,517 323-3405), for
* Wildcat! boards, and for Bob Mahoney's Exec-PC BBS.
* Always adding more prompts to accomodate more BBS types.
* In general, turn any BBS HOTKEY option to OFF.
*
┌─────────────────────────────┐
│ Standard Online Responses │ (For the Generic Logon Routine)
└─────────────────────────────┘
* Responses to common logging-on prompts.
* :name sends first plus last name with one carriage return.
* :f&l sends "first name <CR>", delays, then sends "last name <CR>"
* :handle sends your handle rather than your name
* Notice that I have a different response to the "First name?"
* prompt for the BBS called Directory Assistance.
{:retu}
{comp debug} ;check %debug
{ifco ,stamp} ;if NUL, go on; else goto :stamp}
{retu} ;Handy label and function assignment
{:stamp}{disp ,,,%_24h%:%_min%.%_sec% LOGON.MAC }
{retu} ;stamp for debugging
{:name} {comp bbsid,dirasnt}
{ifco lof1} ;If BBSid=DIRASNT, send TURBO login
{send ~%name%|} ; otherwise, just send name.
{retu}
{:lof1} {send %name %_pas !main|}
{alar 1} {retu}
{:f&l} {inst %name, } ;find "space" in name
{setv pos,%_pos} {decr pos}
{subs first,1,%pos,%name}
{leng %name} {incr pos,2}
{subs last,%pos,%_len,%name}
{send ~%first|~~~~~%last|} ;Send first and last name 2.5 sec apart
{setv first} ;reset variables
{setv last}
{retu}
{:handle}
{send %handle|} {goto retu} ;Send %handle
{:lov} {send ~%v_ph%|} {goto retu} ;Voice Phone Number verification
{:lod} {send ~%d_ph%|} {goto retu} ;Data Phone Number verification
{:lob} {send ~%b_day%|} {goto retu} ;Birthday verification
{:loq} {send ~~%grafix%|} {goto retu} ;choose ANSI colors "Y/n"
{:_} {send ~ } {goto retu} ;this is how to send "SpaceBar"
{:|} {send ~|} {goto retu}
{:_|} {send ~ |} {goto retu}
{:c|} {send ~c|} {goto retu}
{:g|} {send ~g|} {goto retu}
{:n} {send ~n} {goto retu}
{:n|} {send ~n|} {goto retu}
{:q} {send ~q} {goto retu}
{:q|} {send ~q|} {goto retu}
{:s|} {send ~s|} {goto retu}
{:y} {send ~y} {goto retu}
{:y|} {send ~y|} {goto retu}
{:z|} {send ~z|} {goto retu}
{:0|} {send ~0|} {goto retu}
{:loe} {send ~~^[^[} {goto retu} ;this is sending two "Esc" presses
{:pas|} {send %_pas|} {goto retu} ;this sends your password
{:mprot}{send %mprot} {goto retu} ;this sends your mail fetching protocol
{:no} {send ~%no} {goto ndl}
{:c_x} {send ~^x~^x^x^x^x^x^x} {goto ndl}
┌─────────────────────────┐
│ Generic Logon Routine │
└─────────────────────────┘
* This logon macro works for times you DON'T want to
* make a mail run. It is designed to get you quickest to the
* "Main BBS Command?" prompt.
*
* It is necessary that this routine be reached via TABLE.MAC
* since several BBS prompts are set there.
{:glr}
disp ,,,Logging on Now^m^j^j
spdc n ;Blind display "for the bold"
{comp bb,maj}
{ifco ,no_jump}
{send ~|}
{paus 2}
{send n|}
{:no_jump}
{sete-p0 esc} ;point to ESCape routine
{setv nodl} {setv count} ;set some working variables
{comp debug}{ifco db_1} ;using %debug variable to open
{capm raw} ; a capture file to facilitate
{setv capture,on} ; troubleshooting when necessary
{capt y} {goto db_2}
{:db_1} {capt n} ;turnoff capture if open
{:db_2} {setl 60,bye,20,|}
{push} ;push + pops ≈ call
{ifca ,alm} ;Skip routine if OFFline
{golo alm,NO CARRIER^m} ;Forces skip when carrier lost
{golo loe, twice} ;send Escape twice "Front End"
{golo loe, (ESC)} ;send Escape twice "Binkley"
{golo loe,ESCape} ;send Escape, another Binkley
{golo _|,Login: } ;NLBBS Front End
{golo n|,A>?} ;just say 'no' RBBS prompt
{golo n|,change?} ;PCBoard "Language" prompt
{golo y|, [Y,n]?} ;MAXIMUS BBS "name?" confirmation
{golo y|,orrect?} ;send 'y' when caller ID is asked
{golo onl,mmand?} ;Logged on via "quick" RBBS logon
{golo %gra_pmt} ;send graphics instructions "TABLE.MAC"
{golo %nam_pmt} ;send name "Prompt from TABLE.MAC"
{golo handle,User-ID:} ;send %handle for Major BBS
; %nam_pmt in TABLE.MAC is 'name,"new":'
{look Password} ;Logon macro now has two "lookfors"
{pops} ; Why? To accomodate more golooks.
{paus 1}
{comp debug,y} {ifco-c stamp}
{call pas|} ;send password
{push}
{ifca ,alm} ;Skip routine if OFFline
{golo %bypass1} ;These BBSware specific 'pause-
{golo %bypass2} ; avoiding-responses' are set in
{golo %bypass3} ; TABLE.MAC
{golo |,to Continue} ;just say 'no' to Continue
{golo n|,[y/n]?} ;just say 'no' to "Y/n"
{golo n|,More?} ;just say 'no' to "More?"
{golo n|,=yes?} ;just say 'no' to "mail scan"
{golo n|,N)?} ;just say 'no' RBBS prompt
{golo lod,TA ph} ;More Wildcat! prompts <sigh>
{golo n|,menu? [} ;No to Wildcat! bulletin menu
{golo c|,se- [C]} ;[C]ontinue to -pause- prompt
{golo pas|,Wrong} ;resend password if necessary
{golo lob,DD-YY]} ;Typical Date of Birth Prompt
{golo |,-on normally ...} ;Charlie's Foxhole front end
{look %bbs_pmt} ;Generic Logon Complete
{:onl} {spdc y} {pops} ;All set. Logged-ON.
{comp debug,y} {ifco-c stamp}
┌─────────────────────────┐
│ Call ACTION Processor │
└─────────────────────────┘
{ifex %_hom%action.%abbr%,,noact} ;CALL "ACTION processor"
{alar 1} {paus 1} {disp ,,,^j^j}
{disp ,18,1E,▌ 'S' to skip ACTION ■ Any other key continues ▐}
{disp ,,,^m}
{setg 15,doact,n} ;if response is <CR>, do!
{gets-h resp,1,doact} ;using Commo for timed branch
{comp resp,s} {ifco noact} ;15 second delay, default=do!
{:doact} {macl action.mac,action} ;ACTION.MAC Returns to :noact
┌─────────────────────────┐
│ MailRun Routine Start │
└─────────────────────────┘
┌────────────────────────────────────────────┐
│ "flagged" events may be called from here │
└────────────────────────────────────────────┘
* A %flag% variable is used to call for NEWFILE scans.
* You should set the %flag variable in COMMO.FON
* Setting .... {flag,n} ... "n" runs :NEWFILES,
*
* This facility is setup for easy expansion.
{:noact}{ifca ,alm} ;If Offline, quit here
{comp bbsid} ;Check %bbsid variable
{ifco esc} ;If empty, quit macro here
{push}
{inst %flag,n} {ifco newfiles} ;otherwise, run %flag
{pops} ; function(s)
┌───────────────────┐
│ MailRun Routine │
└───────────────────┘
* Checking for a .REP file. If a REP exists, you are offered
* the option to only upload those replies. But, the default action
* is to get a QWK. This way, unattended sessions fetch a .QWK
* Or, by setting the variable %skip to "nl", you can skip the
* attempt to download mail from the "NLBBS".
{comp skip,%abbr} {ifco n_d} ;"skip" flags
{comp skip,y} {ifco n_d}
{ifex %repdr\%bbsid.%rep,ask,d_l} ;GOTO mailrun routines
{:ask} {alar 1} {paus 1} {disp ,,,^j^j}
{disp ,18,1E,▌ (C)ontinue mail d/l NOW ■ 'S' to skip d/l ▐}
{disp ,,,^m}
{setg 15,d_l,n}{gets-h resp,1,d_l} ;using Commo for timed branch
{comp resp,c} {ifco d_l} ;15 second delay, default=d/l
{comp resp, } {ifco d_l}
{comp resp,s} {ifco n_d}
{:n_d} {setv nodl,y} ;set flag to skip mail d/l
{ifex %repdr\%bbsid.%rep,,byz} ;if no .rep, Goodbye
┌───────────────────────────────┐
│ Get to the Mail Door Prompt │
└───────────────────────────────┘
{:d_l} {ifca ,retu} ;return to COMMO.MAC if offline
{send ~~%dorno}
{setl 60,bye,30,%yes}
{golo byz,invalid} ;for invalid door selection
{golo byz,%bbs_pmt} ;if unable to enter door
{push}
{golo |,inue>} ;for Jimmer Startup
{golo |,inue:} ;for JetMail Startup
{golo |,inue?} ;for MarkMail Startup
{golo |,[ENTER]} ;for JCQwk Startup
{golo y|,inue...} ;for QM4 prompt
{golo ndl,sorry,} ;for T.A.G. unable to enter door
{look %md_pmt} ;from TABLE.MAC prompt table
{comp debug,y} {ifco-c stamp}
┌─────────────────┐
│ Upload a .REP │
└─────────────────┘
* If a .REP exists, it is sent before any attempt is made to download.
{:qul} {pops}
{ifca ,retu}
{ifex %repdr\%bbsid.%rep,,nup}
{send ~~%up}
{setl 30,bye,,}
{call ulrep-%mprot} ;%mprot selected in CS-MACxx.CFG
{ifca ,bya}
{setl 60,bye,15,|}
{push}
{golo |,inue?} ;for MarkMail
{golo |,[ENTER]} ;for JCQwk
{golo y|,inue...} ;for QM4 prompt
{look %md_pmt}
{comp debug,y} {ifco-c stamp}
┌───────────────────┐
│ Download a .QWK │
└───────────────────┘
* The ":nup" section would be skipped if you decided to skip .QWK
* downloading in the "Mailrun Routine Start, :ask" section.
{:nup} {pops}
{comp nodl,y} {ifco ,mdn} ;Skip d/l if %nodl=y
{comp mail,dcq} {ifco mt_2};These maildoors need to quit
{comp mail,zns} {ifco mt_2}; to BBS before Goodbye
{goto byz}
{:mdn} {send ~~~%dn} ;Otherwise, scan for messages
{push}
{setl 100,bye,45,%yes}
{golo p_flg,extracting personal mail} ;ZIPNEWS personal mail
{golo ndl,%mt_qwk} ;eMpTy .QWK message "from TABLE.MAC"
{golo %md_brnch} ;Branch, refer to MAILware TABLE.MAC
{golo n,[N T Q]?} ;LAKOTA Download menu (new messages)
{golo y,[A S Y Q]?} ;LAKOTA Conference menu (Your queue)
{golo mprot,[X Y Z Q]?} ;LAKOTA Protocol menu (use %mprot)
{look Message Count}
{goto qdl}
{:p_flg}{setv pmail,y} {retu} ;Causes "P" display in Autopilot Mode
;Cleared on Alt-C or on Alt-A "No" response
┌──────────────────┐
│ Count Messages │
└──────────────────┘
* It is possible to add counting routines specific to any MAILware.
* Use the variable %md_branch defined in TABLE.MAC to choose the
* appropriate message counting routine.
*
* This section will skip the RENQWK and any attempt to download if
* the maildoor scans less than 30 messages for your .QWK packet.
{:c_mm2}
{setg ,,l,^m} ;MarkMail2 message counting
{gets count,15} ;get total message count w/ANSI
{subs count,-4,4,%count} ;take last 4 characters total
{look sages: } ;MM2 personal message count
{gets person,15} ;get personal message count w/ANSI
{subs person,-4,4,%person} ;take last 4 characters personal
{golo ndl,%mt_qwk} ;eMpTy .QWK message "from TABLE.MAC"
{look %xfer_pmt}
{comp person,1} ;check for personal messages
{ifco-GE qdl} ; if any, do download ... but ...
{comp count,30} ;if less than 30 total messages,
{ifco-L no,qdl} ; then skip download
{:c_qm2}
{setg ,,l,^m} ;Qmail2 message counting
{gets count,17} ;get total message count
{subs count,-4,4,%count} ;take last 4 characters total
{look gs Found....} ;QM2 personal message count
{gets person,17} ;get personal message count
{subs person,-4,4,%person} ;take last 4 characters personal
{golo ndl,%mt_qwk} ;eMpTy .QWK message "from TABLE.MAC"
{look %xfer_pmt}
{comp person,1} ;check for personal messages
{ifco-GE qdl} ; if any, do download ... but ...
{comp count,30} ;if less than 30 total messages,
{ifco-L no,qdl} ; then skip download
{:c_qm4}
{setg ,,l,^m} ;Qmail4 message counting
{gets count,17} ;get total message count
{subs count,-4,4,%count} ;take last 4 characters total
{look Found.....} ;QM4 personal message count
{gets person,17} ;get personal message count
{subs person,-4,4,%person} ;take last 4 characters personal
{golo ndl,%mt_qwk} ;eMpTy .QWK message "from TABLE.MAC"
{look %xfer_pmt}
{comp person,1} ;check for personal messages
{ifco-GE qdl} ; if any, do download ... but ...
{comp count,30} ;if less than 30 total messages,
{ifco-L no,qdl} ; then skip download
{:c_coq}
{setg ,,l,^m} ;Message counting
{gets count,74} ;for Charlie's Offline Reader
{subs count,-3,3,%count} ;take last 3 characters total
{golo ndl,%mt_qwk} ;eMpTy .QWK message "from TABLE.MAC"
{look %xfer_pmt}
{comp count,25}
{ifco-L no,qdl}
{:c_roz}
{setg ,,l,^m} ;Rosemail message counting
{gets count,4} ;get total message count
{subs count,-4,4,%count} ;take last 4 characters total
{look you :} ;Rosemail personal message count
{gets person,4} ;get personal message count
{subs person,-4,4,%person} ;take last 4 characters personal
{golo ndl,%mt_qwk} ;eMpTy .QWK message "from TABLE.MAC"
{look %xfer_pmt}
{comp person,1} ;check for personal messages
{ifco-GE qdl} ; if any, do download ... but ...
{comp count,30} ;if less than 30 total messages,
{ifco-L no,qdl} ; then skip download
{:c_zns}
{setg ,,l,^m} ;Message counting for
{gets count,9} ;Jack Kilday's ZIPNews door
{subs count,-3,3,%count}
{golo ndl,%mt_qwk} ;ZIPNEWS "empty" occurs after count
{look %xfer_pmt}
{comp pmail,y} ;Check if Personal Mail flag is set
{ifco qdl} ;Take a packet with personal mail
{comp count,30}
{ifco-L no,qdl}
{:c_mmj}
{setg ,,l,^m} ;Message counting for
{gets count,5} ;MajorBBS QWK mail facility
{look %xfer_pmt}
{inst count,[}
{setv pos,%_pos} {decr pos}
{subs count,1,%pos,%count}
{comp count,30}
{ifco-L no,qdl}
{:c_p15}
{setg ,,l,^m} ;Message counting for
{gets count,5} ;PCBoard 15.0 built-in QWK mail facility
{look %xfer_pmt}
{comp count,30}
{ifco-L c_x,qdl}
{:c_cam}
{setg ,,l,^m} ;Cam-Mail message counting
{gets person,15} ;get personal message count w/ANSI
{subs person,-4,4,%person} ;take last 4 characters total
{look .......} ;CamMail total message count
{gets count,15} ;get total message count w/ANSI
{subs count,-4,4,%count} ;take last 4 characters total
{golo ndl,%mt_qwk} ;eMpTy .QWK message "from TABLE.MAC"
{look %xfer_pmt}
{comp person,1} ;check for personal messages
{ifco-GE qdl} ; if any, do download ... but ...
{comp count,30} ;if less than 30 total messages,
{ifco-L no,qdl} ; then skip download
┌────────────────────────────┐
│ .QWK rename and Download │
└────────────────────────────┘
* Renaming is much faster with one call to a batch file than several
* COMMO calls to command.com. Passing these variables from COMMO.MAC
* to renqwk.bat. %1 = %qwkdr : %2 = %bbsid : %3 = %abbr %4 = %qwk
*
*┌--------------- renqwk.bat -┐ <-- cut here --
*| @echo off |
*| ctty nul |
*| |
*| del %1\%3__5.%4 |
*| ren %1\%3__4.%4 %3__5.%4 |
*| ren %1\%3__3.%4 %3__4.%4 |
*| ren %1\%3__2.%4 %3__3.%4 |
*| ren %1\%3__1.%4 %3__2.%4 |
*| ren %1\%2.%4 %3__1.%4 |
*| |
*| ctty con |
*└------------------------------┘ <-- cut here --
*
* An option to the BAT file renaming method is to do renaming
* with a macro. Several macro methods are later in this file.
* You choose which method to use by presence or absence of renqwk.bat
* in your Commo home directory and by choice of %qrdr and %znr
* variables in your CS-MACxx.CFG file.
*
* renqwk.bat present in Commo home directory ... use renqwk.bat
* renqwk.bat absent from Commo home directory ... use :renqwk macro
{:qdl} {pops}
{push} ;return here from :renqwk
{ifex %qwkdr\%bbsid.%qwk,,gonow};check for .QWK before rename
{ifex %_hom%renqwk.bat,,renqwk} ;use .BAT if it exists
* ; otherwise use :renqwk routine
* ; later in this Commo macro.
*
{exec-n %_hom%renqwk %qwkdr %bbsid %abbr %qwk} ;.QWKfile rename
* ; via renqwk.bat
{:gonow}{send ~~%yes}
{call dlqwk-%mprot} ;download the .qwk
{ifca ,bya}
{:ndl} {pops}
{setl 40,bye,15,|}
{comp mail,dcq} ;DCQwk does not have a logoff
{ifco md_bbs} ; from door facility.
{comp mail,mmj} ;MajorBBS qwkmail does not have a logoff
{ifco md_bbs} ; from door facility.
{comp mail,zns} ;ZIPNEWS does not have a logoff
{ifco md_bbs} ; from door facility.
{comp mail,lak} ;LAKOTA does not have a logoff
{ifco md_bbs} ; from door facility.
{goto notag}
{:md_bbs}
{golo byz,%bbs_pmt} ;any maildoor returning to BBS
{look %md_pmt}
{:mt_2} {send ~~%quit}
{:md_2} {setv quit,|} ;Reset %quit
{setv mail}
{:notag}{push}
{setl 60,bye,15,|}
{golo y|,inue...} ;for QM4 "continue" prompt
{golo |,inue?} ;for MarkMail
{golo |,[ENTER]} ;for JCQwk
{golo byz,%bbs_pmt} ;any maildoor returning to BBS
{look %md_pmt} ;from MailDoor prompt table
┌───────────────────────────────────────────────────────────────────┐
│ Loop to TABLE.MAC and LOGON:noact for multiple doors in one call │
└───────────────────────────────────────────────────────────────────┘
* The variable %bbs is set to NUL on the first pass through TABLE.MAC.
* When TABLE.MAC,%mail is called with a NUL %bbs variable, TABLE.MAC
* will return control to LOGON:noact
* To enter a second door on one call, set a variable, %door2, in
* COMMO.FON. You will set %mail, %dorno, and %bbsid in %door2.
* ────┬───── ────┬ ───┬── ┬─────
* └─────> Example; (door2,znr,zipnews|,nlbbs)
{:byz} {pops}
{comp door2} ;is there a %door2 variable?
{ifco byz2} ;if not, bye now!
{send ~~%quit} ;quit the mail door
{setl 60,bye,10,|} ;send empty CR to clear "extra" commands
{look %bbs_pmt}
{inst door2,,} ;find first "," in %door2
{setv pos,%_pos} {decr pos}
{subs mail,1,%pos,%door2} ;portion before "," is %mail (MAILWare)
{incr pos,2}
{subs door2,%pos,80,%door2};portion after "," is %dorno and %bbsid
{inst door2,,} ;find second "," in %door2
{setv pos,%_pos} {decr pos}
{subs dorno,1,%pos,%door2} ;portion before "," is %dorno entry command
{incr pos,2}
{subs bbsid,%pos,9,%door2} ;portion after "," is %bbsid
{setv door2} ;clear second door variable
{setv nodl} ;allow packet d/l from second door
{macl table.mac,qwk} ;Will return to LOGON.MAC:noact
┌──────────────────────┐
│ LogOFF or Stay on? │
└──────────────────────┘
* Again a choice. Default is to end the connection, but you may
* stay ONLINE if you wish. The macro is setup to open a capture
* file if you choose to stay online.
{:byz2} {paus 1} {alarm 1} {parm ,,,,0} {disp ,,,^j^j}
{disp ,18,1E,▌ 'G' to LogOFF NOW ■ SpaceBar to stay ON ▐}
{disp ,,,^m}
{setg 10,bye,n} {gets-h resp,1,bye};using Commo for timed branch
{comp resp,g} {ifco bye} ;10 second delay, default=bye
{comp resp, } {ifco sta}
{:sta} {clea} ;"Stay" routine
{setv bbsid}
{setv capture} ;clear flag to avoid closing .CAP
{macl %_mac,chm} ;commo.mac:chm opens capture file
{:bye} {ifca ,alm} ;Skip routine if OFFline
{send %bye%%rs}
{setl 10,,,}
{push}
{golo loe,<esc>} ;stifle host delays
{golo y|, log off }
{golo y|, logoff? }
{golo n|, comment }
{golo y|,Are you sure} ;MajorBBS
{golo y|,Log Off?} ;Virtual BBS
{golo g|,[G] Goodbye...} ;Babble
{golo |,?=help]?} ;Charlie's Foxhole
{golo n,your choice -->} ;EXEC-PC
{golo |,to continue:} ;Babble
{look NO CARRIER^m^j} ;comes from modem
{pops}
{:bya} {hang y}
{setv lastcall,%bbsid} ;save lastcall info
{setv bbsid} {setv dorno} ;and recycle variables
{setv nodl} {setv abbr}
{paus 3}
{macl %_mac,%m_call} ;Dial next marked BBS
{:esc} {setv m_call} ;if exit by pressing ESCape
{:alm} {setv bbsid} ; or if exit w/NO CARRIER,
{setv abbr} ; leave this macro routine
{macl %_mac,%m_call} ; return to "home" macro.
┌──────────────────────────────┐
│ .QWK file rename via macro │
└──────────────────────────────┘
* There are many ways to rename mail packets. The variable %rdr
* is used to branch to whatever rename method you prefer. The
* default method uses the date as part of the name and allows
* up to 10 .qwk packets of the same date
* (NL-1108.QWK --> NL-1108.QW0 --> NL-1108.QW1 --> etc.)
*
* It would be very easy to change this progression to keep
* the file extension ".qwk"
* (NL-1108.QWK --> NL-11080.QWK --> NL-11081.QWK --> etc.)
{:renqwk}
{comp rdr} {ifco ,%rdr}
{:qwk} {ifex %qwkdr\%abbr%-%_mon%%_day.%qwk,m_dat}
{exec-n ren %qwkdr\%bbsid.%qwk %abbr%-%_mon%%_day.%qwk}
{retu}
{:m_dat}{setv count,0}
{:m_lop}{ifex %qwkdr\%abbr%-%_mon%%_day.qw%count,,r_mul}
{incr count}
{goto m_lop}
{:r_mul}{exec-n ren %qwkdr\%bbsid.%qwk %abbr%-%_mon%%_day.qw%count}
{retu}
* Rename method ala JABBER.
*
{:jbr} {exec-n dir %qwkdr\%bbsid.* > %ramdr\temp}
{setv ext,0}
{rope %ramdr\temp,j_ren}
{:jbr_l}{read line}
{subs count,10,3,%line}
{comp count,%ext}
{ifco-ge ,jbr_l}
{setv ext,%count}
{goto jbr_l}
{:j_ren}{incr ext}
{leng %ext}
{comp %_len,3} {ifco n_pad}
{comp %_len,2} {ifco 1_pad}
{setv ext,0%ext}
{:1_pad}{setv ext,0%ext}
{:n_pad}{exec-n ren %qwkdr\%bbsid.%qwk %bbsid.%ext}
{retu}
* Rename method ala ZIPNEWS
*
{:znr} {exec-n dir %znpak\%bbsid.z* > %ramdr\temp}
{setv ext,0}
{rope %ramdr\temp,z_ren}
{:znr_l}{read line}
{subs count,11,2,%line}
{comp count,%ext}
{ifco-ge ,znr_l}
{setv ext,%count}
{goto znr_l}
{:z_ren}{incr ext}
{leng %ext}
{comp %_len,2} {ifco no_pd}
{setv ext,0%ext}
{:no_pd}{exec-n ren %znpak\%bbsid.%qwk %bbsid.z%ext}
{retu}
┌──────────────────────────────────────┐
│ .QWK and .REP protocol subroutines │
└──────────────────────────────────────┘
* This arrangement provides a method to use a variety of mail
* transfer protocols.
┌──────────┐
│ Zmodem │
└──────────┘
{:ulrep-z}
{:ulrep-} ;default protocol is "Z"
{look ^xB01} ;Zmodem .REP Upload
{exec-dn %z_prog port %_por ha bo sz -m %repdr\%bbsid.%rep}
{ifer 1,,delrep}
{retu}
{:dlqwk-z}
{:dlqwk-} ;default protocol is "Z"
{golo byz,%md_pmt} ;maildoor packing error
{push} ;Zmodem .QWK Download
{golo g|,<G> to start} ;for DCQwk/TAG
{golo |,or wait 10} ;for Charlie's OffLineQWK
{look ^xB00}
{pops}
{exec-dn %z_prog port %_por ha bo rz -mr %qwkdr}
{retu}
┌──────────┐
│ Ymodem │
└──────────┘
{:ulrep-y} ;Ymodem .REP Upload
{paus 5}
{symo-k %repdr\%bbsid.%rep}
{ifer 1,,delrep} ;Goto delete .REP if trans OK
{retu}
{:dlqwk-y} ;Ymodem .QWK Download
{paus 5}
{send g} ;for DCQwk/TAG
{rymo-y %qwkdr} ;overwrite exiting files
{retu}
┌──────────┐
│ Xmodem │
└──────────┘
{:ulrep-x} ;Xmodem .REP Upload
{paus 5}
{sxmo-k %repdr\%bbsid.%rep}
{ifer 1,,delrep} ;Goto delete .REP if trans OK
{retu}
{:dlqwk-x} ;Xmodem .QWK Download
{paus 5}
{send g}
{rxmo-y %qwkdr\%bbsid.%qwk}
{retu}
┌────────────────────┐
│ .REP File Delete │
└────────────────────┘
{:delrep}
(golo retu,%failed_msg) ;If "failed" message, do not delrep
(look %succeed_msg) ;Lookfor "success" message before delrep
{exec-n del %repdr\%bbsid.%rep}
{retu}
┌────────────────────────────────────────┐
│ Functions called from %flag variable │
└────────────────────────────────────────┘
{:newfiles}
{setv strip,n}
{call stripflag}
{clea}
{send n s u|}
{capt y,%savedir\newfiles.%abbr}
{push}
{golo |,more?}
{look %bbs_pmt}
{pops}
{clea}
{capt n}
{send ~~|}
{retu}
┌──────────────────────────────────────────┐
│ Strip the acted-on function from %flag │
└──────────────────────────────────────────┘
* This subroutine strips the variable %flag of one character
* so that each %flag function is run only once.
{:stripflag}
{inst %flag,%strip}
{comp _pos,1} {ifco fl2}
{setv pos,%_pos} {decr pos}
{subs flag1,1,%pos,%flag}
{:fl2} {setv pos,%_pos} {incr pos}
{subs flag2,%pos,36,%flag}
{setv flag,%flag1%%flag2}
{setv pos}
{setv strip}
{setv flag1}
{setv flag2}
{retu}