home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
modem
/
cs_mac08.zip
/
CS-COMMO.MAC
< prev
next >
Wrap
Text File
|
1993-10-24
|
50KB
|
1,105 lines
┌────────────────────────────────┐
│ Chuck Seyboldt's COMMO Macro │ CS-MAC08:CS-COMMO.MAC
└────────────────────────────────┘
* Variables are set in a CS-MACxx.CFG file (xx = version number).
* You may rename CS-COMMO.MAC to COMMO.MAC or use Commo's "/m" switch
* (as in /mcs-commo.mac) to allow COMMO.MAC and CS-COMMO.MAC to coexist.
* See CS-MAC.MAC for more explanations.
*
Thanks to Fred Brucker for Commo and to ...
- Jim Bennett for many excellent suggestions
- Jim Rahfeldt for macro streamlining ideas
- Paula Stockholm for serious troubleshooting
- Dave Legault for the ongoing ideas and support
- Kevin Nathan for insightful new challenges and effort
- My wife, Joy, for putting up with a Commo addict
*
* With this line in COMMO.SET, Commo starts with the :start macro
* └──┴─────> {mac=start} Startup macro label
*
* I use the :start/cs-macxx.cfg tool for easy portability from one machine
* to another. Many directories are defined in CS-MACxx.CFG.
! You need the edit the file you are reading -AND- COMMO.FON.
* Editing is required only at the *END* of CS-COMMO.MAC.
*
! Edit the .FON links at the _very_ end of this file [^PgDn].
! Please edit the autopilot before enabling it with "setv auto,y".
* There is no other required editing in the CS-MAC series.
┌─────────────────┐
│ Startup Macro │ In COMMO.SET, {mac=start} Startup macro label
└─────────────────┘
{:start}{:af3}
{clea}
{setv ver,08} ;Version level set here
{ifex %_hom%cs-mac*.cfg,,new_user} ;If no .CFG exists, make one
{ifex %_hom%cs-mac%ver%.cfg,,upgrade} ;If old .CFG exists, upgrade
{rope %_hom%cs-mac%ver%.cfg,alcc} ;open .CFG file
{:init_loop}
{read line} ;read CS-MACxx.CFG
{inst line,*} {ifco init_loop} ;skip comments in .cfg
{comp line} {ifco init_loop} ;skip blank lines in .cfg
{inst line,,} {ifco ,init_loop} ;comma reqd in active .cfg line
{setv pos,%_pos} {decr pos}
{subs var,1,%pos,%line} ;all before comma is var_name
{inst line, } {ifco ,no_com} ;two consecutive spaces separate
{setv pos,%_pos} {decr pos} ; variable def'n from comment
{subs line,1,%pos,%line}
{:no_com}
{inst line,,}
{setv pos,%_pos}
{leng %line}
{setv len,%_len}
{decr len,%pos} {incr pos}
{subs valu,%pos,%len,%line}
{setv %%var,%valu} ;setv according to .cfg
{goto init_loop} ;loop until .cfg all read
{:upgrade} ;if old .cfg is found make
{setv ug,y} ; a new one for this version
{macl cs-mac.mac,upgrade}
{:new_user} ;if *NO* .cfg is found make one
{setv new,y} ;autoload macro menu; new user
{macl cs-mac.mac,new_user}
{:alcc} {comp debug,y} {ifco retu}
{capt n,%cap} ;capture filename from .CFG
{setv-e _uselog,DSZLOG} ;DSZlog info > COMMO.LOG
{setv grafix,%color%%fast} ;combine %color & %fast
{:alc} ;CLEAR function ...
{capm s} ; reset capture to 'screen' mode
{parm ,,,,0} ; plus resets directories
{setv abbr} {setv bbsid} ; and working variables
{setv line} {setv var}
{setv valu} {setv pos}
{setv color} {setv fast}
{setv set} {setv len}
{setv pmail} ;ZIPNews personal mail flag
{setv m_call,aln} ;return flag for multidial
{clea}
{setv row,1} {setv col,1}
{comp new,y} {ifco alm} ;New user taken directly to menu
{comp ug,y} {ifco alm} ;Upgrade taken directly to menu
{:no_new}
{setv ring,0} {setv ring_c,0} ;Autopilot ring counters
{comp auto,y}{ifco auto} ;Is autopilot enabled?
;END of startup macro
{:retu} {retu} ;Very handy labelname
macr_do
Run a Macro Choose Macro to Run
╒═══════════════════════╕
Add BBSID to COMMO.FON │ CS-MAC.MAC,new_bbsid │ {macl cs-mac.mac,new_bbsid}
New modem config │ CS-MAC.MAC,modem │ {macl cs-mac.mac,modem}
Run Agenda Generator │ CS-MAC.MAC,s_menu │ {setv auto} {macl cs-mac.mac,s_menu}
Run ACTION processor │ ACTION.MAC,action │ {macl action.mac,action}
Macro under development │ HOLO.MAC,start_ho │ {macl holo.mac,start_ho}
Strip comments from MAC │ CS-MAC.MAC,strip │ {macl cs-mac.mac,strip}
Translate MODEMs.DAT │ CS-MAC.MAC,x_late │ {macl cs-mac.mac,x_late}
RingLOG Macro {:sf5} │ RINGLOG.MAC,g01 │ {setv set} {comp auto,y} {ifco auto} {macl ringlog.mac,g01}
DosFunc Macro {:nf9} │ DOSFUNC.MAC,g01 │ {macl dosfunc.mac,g01}
Make ACTION {:alf} │ ACTION.MAC, alf │ {macl action.mac,alf}
Load HOST Mode {:af5} │ MACROBBS.MAC,bbs │ {macl macrobbs.mac,bbs}
│ EDIT File Menu │ {call alq} {}
╘═══════════════════════╛
upld
Send a File UpLoad Protocols
╒════════════════╕
│ Zmodem │ {setv m_call,z_up} {call cpu} {:z_up} {setv m_call} {exec-n %z_prog port %_por ha bo sz -m @%_hom%^(send^).lst} {call del_lst} {}
│ Zmodem/REP │ {inpu file,.REP to Upload} {ifex %repdr\%file.rep,,no_rep} {exec-N %z_prog port %_por ha bo sz -mu %repdr%\%file%.rep} {:no_rep} {}
│ Ymodem/G │ {setv m_call,y_up} {call cpu} {:y_up} {setv m_call} {symo-gk @%_hom%^(send^).lst} {call del_lst} {}
│ 1k-Xmodem │ {setv proto,1K-Xmodem} {call gfnu} {sxmo-k %file} {setv proto} {}
│ Xmodem CRC │ {setv proto,Xmodem-CRC}{call gfnu} {sxmo %file} {setv proto} {}
│ HS/Link │ {setv m_call,h_up} {call cpu} {:h_up} {setv m_call} {exec-n %dosdir%\hslink.exe -@ -I2 -NV -P%_por% @%_hom%^(send^).lst} {call del_lst} {}
│ │
│ ASCII │ {setv proto,ASCII} {call gfnu} {asci-e %file} {}
╘════════════════╛
downld
Receive a File DownLoad Protocols
╒════════════════╕
│ Zmodem │ {exec-n %z_prog port %_por rz -mr %dldir} {}
│ Zmodem/QWK │ {exec-n %z_prog port %_por rz -m %qwkdr} {}
│ Ymodem/G │ {rymo-gy %dldir} {}
│ 1k-Xmodem │ {setv file,%dldir%\} {inpu file,Filename to Download (1k-Xmodem)} {rxmo %file} {}
│ Xmodem CRC │ {setv file,%dldir%\} {inpu file,Filename to Download (Xmodem CRC)} {rxmo %file} {}
│ HS/Link │ {exec-n %dosdir%\hslink.exe -@ -C -I2 -NV -P%_por% -R -O -K -U%dldir} {}
│ Ymodem │ {rymo-y %dldir} {}
│ ASCII │ {call chm} {}
╘════════════════╛
{:alm} {setv ug} {setv new}
{macr macr_do} {retu} ;Run a Macro menu
{:pgd} {macr downld} {retu} ;Call Download Menu
{:pgu} {macr upld} {retu} ;Call Upload Menu
{:cpu} {exec-n cd %uldir} ;Pick N Send
{ifex %_hom%^(send^).lst,retu}
{comp ext_fl}
{ifco ,pns}
{macl select.mac,start}
{:pns} {exec-d %ext_fl %_hom%^(send^).lst -F}
{retu}
{:del_lst}
{exec-n del %_hom%^(send^).lst}
{retu}
┌───────────────────────┐
│ Get Upload FileName │
└───────────────────────┘
* This version of :GFNU has some extra features. If you omit the file
* .extension, :gfnu looks for the file, adds ".ZIP" and looks for the file,
* if the file doesn't exist, a masked directory list is presented to jog
* your memory.
{:gfnu} {sete-p0 retu}
{setv file,%uldir\%mask} {setv dmask} {setv mask}
{inpu file,Filename for %proto% upload (.ZIP default)}
{ifex %file,retu}
{leng %uldir} {setv dr_len,%_len}
{leng %file} {setv f_len,%_len}
{incr dr_len} {decr f_len,%dr_len} {incr dr_len}
{inst file,.} {ifco chek}
{setv file,%file%.zip}
{:chek} {ifex %file,retu}
{:mask} {subs dmask,%dr_len,1,%file}
{subs mask,%dr_len,%f_len,%file}
{exec-nw5 dir %uldir%\%dmask%*.*}
{goto gfnu}
┌───────────────────────────────┐
│ Send DESC.SDI Automatically │
└───────────────────────────────┘
* This INSERT-key routine sends either desc.sdi or file_id.diz
* If you use the INS routine immediatly after an upload, the
* correct filename will already be in the input window.
{:ins} {ifca ,retu} ;Auto Insert file descriptions
{sete-p0 retu}
{comp file} {ifco ,n_zup}
{ifex %_hom%^(send^).lst,,retu}
{rope %_hom%^(send^).lst}
{read file} {rclo}
{:n_zup}{inpu file,Filename to search for description}
{comp file} {ifco retu} {ifex %file,,retu}
{exec-d %pk_un -v %file desc.sdi file_id.diz}
{ifer 1,retu} {setv filen,file_id.diz}
{:add_dsc}
{exec-d %pk_un -v %file %filen}
{ifer 1,chk_sdi}
{exec-n %pk_un -o %file %ramdr\ %filen}
{rope %ramdr\%filen,retu}
{:diz_lp}
{setv filen}
{read line} {send ~~%line|}
{goto diz_lp}
{:chk_sdi}
{setv filen,desc.sdi}
{goto add_dsc}
┌───────────────────────────┐
│ Select Upload Directory │
└───────────────────────────┘
* This Alt-U macro has a twist to it. Pressing the ESCAPE key while in
* the INPUt window doesn't exit. Instead the ESCAPE key cycles through
* a variety of U/L directory choices before exiting.
{:alu} {setv count,0}
{:conf} {incr count}
{sete-p0 ul%count}
{inpu uldir,Select Upload directory (omit trailing"\")}
{ifex %uldir\NUL,retu,alu}
{:ul1} {setv uldir,%_hom}
{leng %_hom} {setv len,%_len}
{decr len} {subs uldir,1,%len,%uldir}
{setv len} {goto conf}
{:ul2} {setv uldir,%ramdr} {goto conf}
{:ul3} {setv uldir,%repdr} {goto conf}
{:ul4} {setv uldir,%dldir} {goto conf}
{:ul5} {retu}
┌──────────────────┐
│ File-Edit-Menu │
└──────────────────┘
{:pad} {setv n_ver,0%n_ver} {retu}
{:alq} {setv n_ver,%ver} {incr n_ver}
{leng %n_ver} {comp _len,1} {ifco-lec pad}
{setv _menu1, F any File}
{setv _menu2, T Table.mac}
{setv _menu3, L Logon.mac}
{setv _menu4, A Action.mac}
{setv _menu5, S cS-mac.mac}
{setv _menu6, X New in v.%n_ver}
{setv _menu7, M Macrobbs.mac}
{setv _menu8, H Holo.mac}
{setv _menu9, K assign.Key}
{setv _menu10, D aDdress book}
{setv _menu11, C Commo.mac}
{setv _menu12, N holo.mac NLBBS}
{setv _menu13, I Ideas}
{setv _menu14, Q Quiz.mac}
{setv _menter,auto}
{setv _mlabel,ed_a,,ed_c,ed_d,,ed_f,ed_g,ed_h,ed_i,,ed_k,ed_l,ed_m,ed_n,,,ed_q,,ed_s,ed_t,,,,ed_x}
{menu 18,22, EDIT Menu }
{goto auto}
{:ed_f} {call nf5} {goto auto}
{:ed_t} {setv file,%_hom%table.mac} {goto ed_it}
{:ed_l} {setv file,%_hom%logon.mac} {goto ed_it}
{:ed_a} {setv file,%_hom%action.mac} {goto ed_it}
{:ed_s} {setv file,%_hom%cs-mac.mac} {goto ed_it}
{:ed_x} {setv file,%_hom%%n_ver} {goto ed_it}
{:ed_m} {setv file,%_hom%macrobbs.mac} {goto ed_it}
{:ed_h} {setv file,%_hom%holo.mac} {goto ed_it}
{:ed_k} {edit %_hom%assign.key} {goto auto}
{:ed_d} {edit %savedir\address} {goto auto}
{:ed_c} {macl cs-mac.mac,ed_cmac}
{:ed_n} {setv file,%_hom%dl\test\*.mac}{goto ed_it}
{:ed_i} {setv file,%savedir\ideas} {goto ed_it}
{:ed_q} {setv file,%_hom%quiz.mac} {goto ed_it}
{:ed_it}{comp ext_ed}
{ifco in_ed}
{exec-n %ext_ed %file} {goto auto}
{:in_ed}{inst file,*} {ifco auto}
{inst file,?} {ifco auto}
{edit %file} {goto auto}
┌──────────────────────────────┐
│ Toggles and Autopilot mode │
└──────────────────────────────┘
{:alt} {togg}
{:a_yn} {setv _menu1, Y yes}
{setv _menu2, N no}
{setv _menu3, C clear ring}
{setv _menter,to_c}
{setv _mlabel,,,to_c,,,,,,,,,,,to_n,,,,,,,,,,,to_y}
{menu 7,23,Autopilot ON?} {retu}
{:to_n} {setv auto}
{:to_c} {setv set} {setv pmail} {setv ring,0} {goto auto}
{:to_y} {setv auto,y} {goto auto}
┌───────────────────────┐
│ Toggle CAPTURE mode │
└───────────────────────┘
* This capture function provides a TOGGLE. Ctl-Home keystroke changes
* the status of capture and provides datestamp marks in the capture file.
{:chm} {comp capture,on} {ifco cof}
{setv capture,on}
{capt y,%savedir\%_mon%%_day%.cap}
{exec-n echo OPENED ■ %_dat %_tim^j>> %_cap} {retu}
{:cof} {setv capture} {capture n}
{exec-n echo CLOSED ■ %_dat %_tim^j■-■-■>> %_cap} {retu}
┌───────────────────────┐
│ Toggle Doorway Mode │
└───────────────────────┘
* This doorway mode toggle has a feature that you need to be aware of.
* The %xpert% flag will make this macro run through a series of possible
* "drop to DOS" commands for a variety of hosts (like the :alu macro).
* If %xpert% is null, this function is a simple toggle.
{:al=} {comp dway} {ifco ,ext}
{setv dway, }
{comp xpert} {ifco door}
{setv count,0}
{:donf} {incr count}
{sete-p0 dw%count}
{inpu dway,Host Doorway Command?}
{comp dway} {ifco retu}
{send %dway} ;BBSware Drop to DOS command
{:door} {door-m0} {}
{:dw1} {setv dway,9 y|} {goto donf} ;Various BBSware
{:dw2} {setv dway,aview|} {goto donf} ;Various BBSware
{:dw3} {setv dway,d~~~~%pword2|}{goto donf} ;"drop to DOS"
{:dw4} {setv dway} {retu}
{:ext} {door-m0}
{setv dway}
{comp xpert} {ifco retu}
{send exit|} ;Return from DOS to BBSware
{retu}
┌───────────────────┐
│---* General *---│
└───────────────────┘
{:alw} {setv file} ;Any Command at all
{inpu file,Enter any DOS Command:}
{comp file} {ifco retu} {exec-W %file} {}
{:list_it}
{ifex %file,,auto}
{comp ext_li}
{ifco in_li}
{exec-n %ext_li %file} {goto auto}
{:in_li}{inst file,*} {ifco auto}
{inst file,?} {ifco auto}
{edit %file} {goto auto}
┌──────────────────────────┐
│---* Terminal Control *---│
└──────────────────────────┘
{:al0} {ligh} {retu} ;Toggle Signal Lights
{:al3} {soun} {retu} ;Toggle Mister Sound
{:al6} {loca} {retu} ;Toggle Local Echo
{:all} {dpar} {capt} {retu} ;Access Connect Parms
{:al-} {statusline} {retu} ;Toggle Status Line
{:alv} {comp vid} {ifco v_m1} ;Toggle video mode
{vide-m0}{setv vid} {retu}
{:v_m1} {vide-m1}{setv vid,1} {retu}
┌──────────────────────┐
│---* Send Strings *---│
└──────────────────────┘
{:nf1} {ifca ,hlp} {send ~~%name|} {retu};Send Name
{:cf1} {send %handle|} {retu}
{:nf2} {send %_pas|} {retu} ;Send Password
{:af2} {send %v_ph|} {retu} ;Send Voice Phone No.
{:cf2} {send %d_ph|} {retu} ;Send Data Phone No.
{:nf0} {ifca ,retu} ;Send Signature
{send %sig%|~|~SN|}{}
┌───────────────────┐
│---* Utilities *---│
└───────────────────┘
{:cra} {setv file,%savedir\savescro} {goto ed_it} ;Edit scrollback saves
{:alg} {edit %_set} {edit %_hom%cs-mac%ver.cfg}{retu} ;Edit Config files
{:af1} {exec-d %z_prog t -8g} {retu} ;DSZ terminal shell
{:cf5} {:cky} {exec-d %utildir%\dfr.com} {retu} ;Directory Freedom
{:nf3} {setv file,%dldir%\} ;External List Pgm
{inpu file,File to List} {goto list_it}
{:nf5} {setv file,%dldir%\} ;External Editor Pgm
{inpu file,File to Edit} {goto ed_it}
{:nf6} {setv file} ;Dial Phone for voice
{inpu file,Name or Number to Call}
{comp file} {ifco retu}
{comp ext_di} ;if %ext_di <> NUL
{ifco ,enf6} ; use external dialer.
{call search} {comp addr} {ifco retu} ;Use internal routine
{inpu addr,Press Space after dial} ;display match,
{subs addr,32,14,%addr} ;phone# in cols 32-45
{spdc n}
{send ATM1DT%addr^m}
{setl 30,retu,, }
{look }
{paus 1}
{spdc y} {retu} ;end internal pgm
{:enf6} {exec-n %ext_di %file} {retu} ; -or- use external pgm
{:nf4} {:shel} {shel} ;Shell To DOS
{subs dr,1,1,%_hom} ;Now, return to Commo
{exec-n %dr:} ; home directory
{leng %_hom}{setv len,%_len}
{decr len}
{subs hom,1,%len,%_hom}
{exec-n cd %hom}
{setv dr} {setv len} {setv hom}
{retu}
{:alj} {exec-w15 mjog /l} {retu} ;Mjog
{:als} {exec-w15 set} {retu} ;See DOS Environment
{:al<} {setv file} {inpu file,See What Variable?} ;See a Commo variable
{comp file} {ifco retu}
{setv-s value,%file}
{inpu %%file,Variable %file,%value} {retu}
{:al.} {setv inpu} {inpu inpu,Variable,Setting} ;Set a Commo variable
{comp inpu} {ifco retu}
{setv %%inpu} {retu}
{:al/} {:loop_1} ;Load another macro file
{setv parm} {setv file} ;initialize variables
{inpu file,Load a Macro}
{comp file} {ifco retu}
{inst file,,} ;Comma used to delimit
{ifco-c g_pm} ; start_label from macro
{inst file,.} ;You may omit ".mac"
{ifco ,mac_test} ; extension
{setv pos,%_pos} {decr pos}
{subs file,1,%pos,%file}
{:mac_test}
{ifex %_hom%%file.mac,,loop_1} ;loop on no-exist
{macl %file.mac%parm} ;load new macro
{:g_pm} {subs parm,%_pos,255,%file}
{setv pos,%_pos} {decr pos}
{subs file,1,%pos,%file}
{retu}
{:alb} {ifca ,backup} ;Dual use Alt-B
{brea} {retu} ; ONLINE = Break
{:backup}
{exec-n %pk_zip -a %savedir\mac %_hom%*.mac} ;Backup Commo Macros
{exec-n %pk_zip -a %savedir\mac %_hom%*.fon} ;Backup Commo FON files
{exec-n copy %savedir\mac.* %bu_dr}
{comp xpert,y} {ifco ,retu} ;if %xpert=y, backup
exec-n %pk_zip -a %dldir\estate %dldir\estate %dldir\706 ; personal
exec-n copy %dldir\estate.z?p %bu_dr ; business
{exec-n %pk_zip -a %savedir\$$ g:\q5\home.*}
{exec-n copy %savedir\$$.z?p %bu_dr}
{retu}
┌────────────────────────────────────────┐
│---* Commo Help and quick reference *---│
└────────────────────────────────────────┘
{:alk} {exec-w60 type %_hom%assign.key} {retu} ;Show Key Assignments
{:hom} {setv file,%ins_dir\*.doc} {goto list_it} ;List Commo DOCS
{:alh} {ifca ,hlp} {hang} {retu} ;Dual use of Alt-H
{:hlp} {help 0} {retu} ; Hangup or HELP
┌─────────────────────────┐
│---* Session History *---│
└─────────────────────────┘
{:upa} {screen n,%savedir\savescro} {scro} {retu} ;Enter Scrollback
{:dna} {setv file,%_cap} {goto ed_it} ;Edit Capture File
{:lfa} {setv file,%_cap} {goto list_it} ;List Capture File
{:rta} {setv file,%savedir\*.cap} {goto list_it} ;Review Past Capture
{:gr+} {screen y,%savedir\commo.scn} {retu} ;Capture Screen
{:gr-} {edit %savedir\commo.scn} {retu} ;Show Screen Capture
{:alr} {setv file,%_uselog} {goto list_it} ;Review Call Log
{:end} {inpu abbr,Which 2-letter ACTION File?} ;Edit ACTION File
{edit %_hom%action.%abbr} {retu}
{:al1} {inpu abbr,Show ->%abbr%<- ACTION} ;Show ACTION history
{comp abbr} {ifco retu}
{subs abbr,1,2,%abbr}
{setv file,%savedir\*.%abbr} {goto list_it}
┌──────────────────────────────────────────┐
│---* Directly view specific filenames *---│
└──────────────────────────────────────────┘
{:cf9} {setv file,%savedir\answer1} {goto list_it} ;View ANSWER1
{:cf0} {setv file,%savedir\*.log} {goto list_it} ;View COASTAL .log files
┌──────────────────────────┐
│---* Messaging macros *---│
└──────────────────────────┘
{:sf3} {exec-n %reader} {retu} ;Run Mail Reader Pgm
{:ala} {ifca ,a_yn} {asci %dldir%\,:} {retu} ;Ascii Upload
{:alo} {scre n,%_hom%quote.in} ;Capture/Quote Message
{scro} {edit %_hom%quote.in}
{ifex %_hom%quote.in,,equote}
{rope %_hom%quote.in,equote}
{:nline}{read line} {send ~-> %line%|}
{goto nline}
{:equote}{send ~|} {exec-n del %_hom%quote.in} {retu}
{:cf6} {inpu bbsid,Note to Edit?} ;Edit Notefile
{edit %savedir\%bbsid%}
{retu}
┌────────────────────┐
│---* Play Space *---│ {:alp} {macr playsp} {}
└────────────────────┘
* This area is useful for playing with new macro ideas.
* It is easily accessed with Alt-P
* {disp ,,,Hi %name%!} {}
{:cua}
{inpu file,Name the macro to Record}
{ifex %_hom%%file,alq}
{wope %_hom%%file}
{setg ,,l}
{sete-p0 end_record}
{:look_loop}
{look ^m}
{gets line}
{writ %line}
{goto look_loop}
{:end_record}
{info-q Quit Macro Recording?}
{ifco ,look_loop}
{sete}
{wclo}
{edit %_hom%%file}
{retu}
{curs} {}
{setg ,,l}
{gets-n line} ;you could fill %line another way
{call num_filter}
{disp ,,,^m^jUnfiltered: %line} ;show variables
{disp ,,,^m^jFiltered: %number^m^j} ;and number
{retu}
{:num_filter}
{leng %line} ;get length of entire string
{setv count,0}
{setv number}
{:num_fil}
{incr count}
{subs char,%count,1,%line}
{comp char,0} {ifco writ_num}
{comp char,1} {ifco writ_num}
{comp char,2} {ifco writ_num}
{comp char,3} {ifco writ_num}
{comp char,4} {ifco writ_num}
{comp char,5} {ifco writ_num}
{comp char,6} {ifco writ_num}
{comp char,7} {ifco writ_num}
{comp char,8} {ifco writ_num}
{comp char,9} {ifco writ_num}
{comp count,%_len}
{ifco retu,num_fil}
{:writ_num}
{setv number,%number%%char}
{comp count,%_len}
{ifco retu,num_fil}
{:gr*} {:cla} ;Test Command here
{disp ,,,This key is used to test any command %_ela^m}
{disp ,,,%_nam %_num}
{retu}
┌────────────────────────────────────────┐
│ Send a Tagline from your Mail Reader │
└────────────────────────────────────────┘
{:cnd} {comp random_t} ;If # of lines variable is NUL
{ifco select_t} ;goto select specific tagline
{setv sec,%_sec} ;maximum 60 lines
{divi sec,%random_t} ;divide a number from 0 to 60
; by #lines in tagfile.
{setv rem,%_rem} ;the remainder is a
{incr rem} ;pseudo random # from 1 to %line
{rope %tagfile,s_tag}
{setv count,1}
{:t_loop}
{read line} ;read a tagline
{comp count,%rem} ;compare current line# with random#
{ifco-E s_tag} ;if same, send_tagline
{incr count} ;otherwise read next tagline
{goto t_loop}
{:s_tag}
{send %line} ;send the tagline
{rclo} ;clean up open files
{setv sec} {setv rem} ;and variables
{retu} ;END random tagline selection
{:select_t} ;START specific tagline selection
{rclo} ;make sure tagfile is closed
{setv cn} ;reset the tagline number seletion
{sete-p0 cnd} ;make <ESC> empty a "wrong" choice
{inpu cn,Choose Tagline Nº}
{comp cn} {ifco retu} ;if no tag number, end the routine
{rope %tagfile,cnd} ;open tagline file
{setv count,0} ;initialize counter
{:t_lp}
{incr count} ;increment counter
{read line} ;read a tagline
{comp cn,%count} ;is this the chosen one?
{ifco ,t_lp} ;if not, loop back
{:p_tag}
{inpu line,Press Enter to Send} ;or <ESC> to skip & reselect
{send %line^m} ;send selected tagline
{setv line} {setv cn} ;reset variables
{retu} ;END of sending specific tagline
┌────────────────────────────────────────────────────────┐
│ An automatic ASCII message entry system for PCBoards │
└────────────────────────────────────────────────────────┘
{:nf8} {setv file,%dldir%\} {inpu file,Name of Upload Message}
{ifex %file%,,n_e}
{parm ,,,,2} {send e|} {asci %file%,}
{parm ,,,,0} {send ~~|~~~sn|}
{look %bbs_pmt}
{disp ,,,^j^j}
{disp ,18,1E,▌ Erase %file%? [Y/n] ▐^m}
{setl 5,y_d,,}
{golo y_d,y}
{golo n_e,n}
{look 'N' Skips Message Delete}
{:y_d} {exec-n del %file}
{:n_e} {send ^h}{disp ,18,, ^m}{}
┌──────────────────────────────────────────────┐
│ A guarded Alt-X command when leaving Commo │
└──────────────────────────────────────────────┘
{:alx} {setv xtime,10} ;set time-to-exit
{setv count,0}
{sete-p0 noex}
{disp 24,1,74, EXIT ^(Commo^) at "%xtime" > }
{disp ,,70, Are you Sure? (Y/n) }
{disp 24,26}
{incr xtime}
{setv count,0} {setv resp} ;initialize variables
{:xlop} {setg 1,upct,n} {gets-h %resp,1,q_t} ;set up 1 second wait
{comp %resp,n} {ifco noex} ;compare response
{comp %resp,y} {ifco q_t} ;if resp = y, goto :q_t
{:upct} {disp 24,26,71,%count} {disp 24,26}
{incr %count} {comp %count,%xtime}
{ifco-G q_t,xlop} ;loop or :q_t
{:noex} {disp 24,1,, ^m}
{setv xtime}
{retu} ;decided to stay
{:q_t} {exit} ;normal exit from Commo
┌────────────────────────────────────────┐
│ A tool to search a file for a string │
└────────────────────────────────────────┘
{:cf3} {inpu file,Name to search from ADDRESS book}
{comp file}
{ifco retu}
{call search}
{setv oldrow,%_row} {setv oldcol,%_col}
{setv row,%_row} {decr row,2}
{disp %row,1,07, ^j}
{comp addr} {ifco retu}
{disp %row,1,20,%addr } {disp %oldrow,%oldcol}
{setv addr} {setv oldcol} {setv row}
{setv file} {setv oldrow} {retu}
{:search}
{rope %savedir\address,retu}
{:aloop}
{read addr}
{inst addr,%file} {ifco ,aloop}
{rclo} {retu}
┌────────────────────────────────────────────────────┐
│ Download list tagging using COMMO built-in tools │
└────────────────────────────────────────────────────┘
* Featuring dual-function Alt-D depending on ON/OFF line Status
{:ald} {ifca mlist} ;Alt-D first checks for CARRIER
{dial}{retu} ;If NO, bring up dialing directory
{:mlist}{scre n,%_hom%dl-list} ;If CARRIER ONLINE, name screen image
{scro} ;Enter scrollback mode:
* ; This is where you will tag files
; Use the "W" facility in scrollback
* ; Press C/R twice on each file to tag
* ; Press ESC to quit tagging. Next,
{edit %_hom%dl-list} ;Enter COMMO's built-in editor:
* ; Add or delete file names, 1 per line
* ; Description text will be stripped
* ; later in the macro.
{rope %_hom%dl-list} ;Open just made list
{read line} ;Read the first line
{rclo} ;Close the list
{comp line} ;Is the first line empty?
{ifco retu} ;If so, quit. Otherwise go on.
{setv file}
{inpu file,C/R to Start DownLoad Now} ;A chance to exit
{comp file} {ifco go-dl} {retu} ; before start of d/l.
{:go-dl}{send d|} ;To the BBS, the download command
* ; (or use the FLAG command)
{rope %_hom%dl-list,end-dl} ;Open file list for reading
{:next-1}
{read file} ;Read one complete line into %file%
{subst file,1,12,%file} ;Strip all but first 12 characters
{send ~~~%file%|} ;Send filename to BBS
{goto next-1} ;Repeat read unti dl-list is all read
{:end-dl}
{exec-n del %_hom%dl-list} ;Delete the list after sending
{send ~|} {retu} ;This macro is ended.
* ;Waiting for Auto-Zmodem d/l?
┌─────────────────────────────┐
│ REP Mark and Dial Routine │
└─────────────────────────────┘
* This automatic mark-and-dial routine will send your .REP files
* It bypasses .QWK download questions with the "SKIP" facility
{:sf4} {unma}
{setv m_call,aln}
{ifex %repdr\*.rep,rep_mark}
{exec-n del %ramdr\rep_dir}
{setv skip}
{goto auto}
{:rep_mark}
{exec-n dir %repdr\*.rep > %ramdr\rep_dir}
{setv skip,y}
{rope %ramdr\rep_dir,aln}
{:r_loop}
{read file}
{inst file,rep} {ifco ,r_loop}
{subs file,1,6,%file}
{mark %file} {goto r_loop}
┌────────────────────────────────────────┐
│ Return Point from cs-mac agenda menu │
└────────────────────────────────────────┘
{:do_agenda}
{setv mt}
{comp hold} {ifco retu}
{hold %hold} {clea}
{goto aln}
┌───────────────────────────────┐
│ Return Point From LOGON.MAC │
└───────────────────────────────┘
{:aln} dial-c 45, goto auto ;Optional simple Multi-dial & Return
┌────────────────────────────────────────┐
│ Dialing Marco for BBS Mailrun Events │ Adapted From: TIM SAARI
└────────────────────────────────────────┘
* If you enclose the above "(dial-c 45,) (goto auto)" in curly braces
* the more complex dialer below will be disabled.
{setv row,%_row} ;Save current cursor location
{setv col,%_col}
{disp 6,10,, }
{setv busy,0} ;Initialize result counters
{setv nodt,0}
{setv voic,0}
{setv carr,0}
{:redial}
{disp %row,%col}
{sete-p0 auto} ;Goto autopilot on ESCape
dial-c 1,,seeya ;More complex
{dial-c 1} ;Less complex
{comp _dtc,0} {ifco auto} ;no systems marked
{comp _dtc,3} {ifco inccarr} ;dialer timed out
{comp _dtc,4} {ifco interve} ;operator intervention
{comp _dialrt,BUSY} {ifco incbusy}
{comp _dialrt,NO DIAL TONE} {ifco incnodt}
{comp _dialrt,VOICE} {ifco incvoic}
{:incbusy}
{incr busy}
{disp 6,32,0B,Busy: %busy}
{setv dialrt,BUSY}
{comp busy,45} ;number of redials for a BUSY result code
{ifco-g ,l_atmpt}
{unma-l} {setv busy,0}
{goto l_atmpt}
{:inccarr}
{incr carr}
{disp 6,64,0B,No Ans: %carr}
{setv dialrt,TIMEOUT}
{comp carr,5} ;unmark on fifth NO ANSWER
{ifco-g ,l_atmpt}
{unma-l} {setv carr,0}
{goto l_atmpt}
{:incnodt}
{incr nodt}
{disp 6,52,0B,No Tone: %nodt}
{comp nodt,9} ;number of redials for a NO DIAL TONE result code
{setv dialrt,NO TONE}
{paus 120}
{ifco-g auto,l_atmpt}
{:incvoic}
{incr voic}
{disp 6,42,0B,Voice: %voic}
{setv dialrt,VOICE}
{comp voic,5} ;number of redials for a VOICE result code
{ifco-g ,l_atmpt}
{unma-l} {setv voic,0}
{goto l_atmpt}
{:interve}
{setv dialrt,OP-INT}
{goto l_atmpt}
{:l_atmpt}
{disp 6,23,0A, } ;Clear prior result
{disp 6,10,0A,Last Attempt: %dialrt } ;Display last result
{goto redial} ;Dial again
┌────────────────────────────────┐
│ Event Outdial Interupt Macro │
└────────────────────────────────┘
{:seeya}{disp ,,,%_dialrt}
{loca n}
{send ata|}
{loca y}
{setg ,,l,^M^J}
{gets constr,40}
{pause 12}
{send %constr%^M^J}
{send You have connected during an attemped mail run.^M^J}
{send Please try again later. See ya.^M^J}
{pause 9}
{hang y}
{look carrier}
{loca n}{retu}
┌─────────────┐
│ Autopilot │
└─────────────┘
* This routine is intended to be always running.
* It is active only when the internal variable %auto% = y
* If active, can be started with Alt-C or Alt-N (and stopped with "P").
* If inactive, can be started with Alt-T or Alt-A.
* It can start any event at a specified time of the day.
* It can run a different event on a particular day of the week.
* While running, :auto logs rings of the phone to a log.
* Enters an auto-answer mode if it receives a single ring.
* Exits auto-answer mode after 35 seconds of inactivity.
*
* You need to edit the autopilot to setup events and event timing.
┌──────────────────────────────────────┐
│ Autopilot converted to Simple Host │
└──────────────────────────────────────┘
* The core of the autopilot routine is later on. This subroutine will
* answer the phone on a pattern of "RING; wait 10-45 seconds; RING RING"
* You need a file called PASSWORD in your Commo home directory.
* The first line of the PASSWORD file is the HOST access protection.
{:ans} {disp 25,1,17,░░░░ ^(Commo^) Autopilot }
{disp 25,34,1e,Waiting for 2 RINGs }
{disp 25,63,17,%_12h%:%_min%.%_sec %_amp% ░░░░}
{setl 35,auto} ;35 seconds in callwait mode
{setv set,y} ;flag indicates callwait set
{look ring}
{disp 25,34,1f,Waiting for 1 RING }
{look ring}
{send ~ATA~|}
{disp 25,34,1b,Waiting for CONNECT }
{look CONNECT}
{disp 25,34,1c,Waiting for Password}
{disp %row,%col}
{spdc y}
{send ~~Hello^j^j|Enter Password: }
{paus 1}
{setg 15,gbye,n}
{gets-p pass,8,gbye}
{ifex %_hom%password,,gbye} ;quit if password file=NUL
{rope %_hom%password}
{read password}
{rclo}
{comp pass,%password}
{ifco ,gbye}
{setv pass}
{setv password}
{ifca ,shel} ;for local HOST testing
{exec %utildir\doorway com%_por /m:60 /g:on /a:on /v:d^u /o:t /s:* /c:dos}
{paus 2}
{send ~~~~^m^jSee you later %name%^m^j~~}
{:gbye} {hang y}
{paus 5}
{goto auto} ;return to Autopilot
┌────────────────────────────────┐
│ RingLog portion of Autopilot │
└────────────────────────────────┘
* Sort of an expensive answering machine enhancement.
* This section of Autopilot logs telephone rings to a save file.
* With an {auto r_log,^m^jRING^m^j} {}, you will log RING out of Autopilot
{:r_log}{exec-N echo Your Phone rang: %_dat at %_24h%:%_min%:%_sec% >> %savedir\ring.log}
{comp auto} {ifco retu}
{comp ring} {ifco no_new}
{incr ring}
{incr ring_c}
{:nlop} {setl 10,ilop} ;After 10 seconds, return to outer loop
{golo r_log,RING}
{look Inside r_log now}
┌─────────────────────────────────────────┐
│ Set Autopilot Keyboard responses here │
└─────────────────────────────────────────┘
* Autopilot can respond to hot-key strokes from the keyboard.
{:ialq} {call e_auto} {call alq} {goto auto} ;Edit menu on "Q"
{:ialh} {call e_auto} {call hom} {goto auto} ;Commo Help on "H"
{:ialm} {call e_auto} {call alm} {goto auto} ;Macro edit on "M"
{:iald} {call e_auto} {call ald} {goto auto} ;Dialer on "D"
{:ialf} {call e_auto} {call alf} {goto auto} ;Filelist on "F"
{:ials} {call e_auto} {call nf4} {goto auto} ;Shell to DOS "S"
{:ialp} {call e_auto} {goto a_yn} ;Autopilot OFF "P"
{:ialx} {call e_auto} {call alx} {goto auto} ;Exit Commo on "X"
{:ialk} {scro} {goto ilop} ;Scrollback on "K"
{:ialu} {call e_auto} {call alr} {goto auto} ;Review Uselog "U"
{:ialb} {call e_auto} {call alb} {goto auto} ;Backup on "B"
{:ialt} {call e_auto} {call nf6} {goto auto} ;Phone Talk on "T"
{:iall} {keys 76e0,51e0,4fe0} ;Ringlog on "L"
{edit %savedir\ring.log} {goto ilop}
{:e_auto} ;End Autopilot subroutine
{spdc y} ;Restore Serial Port Display
{stat y} ;Restore status line
{setv ring_c} ;Reset ring counter
{setv time}
{disp %row,%col} {retu} ;Restore cursor location
┌──────────────────────────┐
│ Autopilot Core Routine │
└──────────────────────────┘
* This is the core of the autopilot routine.
* Near the end of the core you will see the setting of event times as
* well as the event definitions.
{exec time} ;start here to test your event additions
{:auto} {pops-c} ;clear the return stack
{setv m_call,aln}
{comp auto,y} ;CS-MAC starts Autopilot here
{ifco ,retu}
{ifca retu} ;don't run autopilot when ONLINE
{sete-p0 e_auto}
{setv row,%_row}
{setv col,%_col}
{setv ring_c,0}
{stat n}
{spdc n}
{disp 25,1,4f,░░░░ ^(Commo^) Autopilot }
{disp 25,34,4e,ESCape quits }
{:ilop} {comp shh,y} {ifco ,sho_t}
{disp 25,63,4f, ░░░░}
{goto q_ti}
{:sho_t}{disp 25,63,4f,%_12h%:%_min%.%_sec %_amp% ░░░░}
{:q_ti} {comp pmail} {ifco no_p} {disp 25,76,4d,P}
{:no_p} {comp set} {ifco nostar} {disp 25,75,4c,*}
{:nostar}
{comp ring,1} {ifco-l noring}
{disp 25,56,47,Rings} {disp 25,53,4b,%ring}
{:noring}
{disp %row,%col}
{comp ring_c,1} {ifco-e ans} ;Goto simple host on 1 ring
{setv ring_c,0}
{setl 10,ilop} ;lookfor . . . indefinitely
{setv time,%_24h%:%_min}
┌───────────────────────────────────┐
│ Set Autopilot Event timing here │
└───────────────────────────────────┘
* This area is used to establish the time at which an autopilot event
* will be run. The event definitions are in the next section.
! All required CS-COMMO.MAC editing is BELOW this line.
! {comp time,17:30} {ifco ev_1} ;Event 1 time here
! {comp time,06:00} {ifco ev_2} ;Event 2 time here
! {comp time,23:59} {ifco ev_3} ;Event 3 time here
! {comp time,01:11} {ifco ev_4} ;Event 4 time here
! {golo r_log,RING} ;log "RING"
; (use your particular modem string)
{golo iall,l} ;List RING.LOG on "L"
{golo ialq,q} ;Editor menu on "Q"
{golo ialh,h} ;Commo Help on "H"
{golo ialm,m} ;Macro editor on "M"
{golo iald,d} ;Dialing directory on "D"
{golo ialf,f} ;Make action file on "F"
{golo ials,s} ;Drop to DOS on "S"
{golo ialp,p} ;Autopilot Toggle on "P"
{golo ialx,x} ;Goto Exit routine on "X"
{golo ialk,k} ;Scrollback on "K"
{golo ialu,u} ;Review Uselog on "U"
{golo ialb,b} ;Backup files "B"
{golo ialt,t} ;Phone Talk on "T"
(golo ----,-) ;(1) left. May use
;"J", "V", "W", "Y", or "Z"
{look Something that won't happen} {goto auto}
┌────────────────────────────────────────┐
│ Set Autopilot Event definitions here │
└────────────────────────────────────────┘
* In general, quit the autopilot (call e_auto), call an event subroutine,
* after the subroutine, (goto auto) ... the autopilot routine.
* You can set up many events, you can restrict event execution to certain
* days of the week
* Event_1 goes to label :sfa on Saturdays. This marks a bunch of BBS
* numbers for a weekend mailrun. If it isn't Saturday, goto :nfa instead.
* Event_2 happens later in the day. This is an Internet mailrun.
* Event_3 looks for .REP files and sends them at midnight.
* Event_4 calls a file backup routine at 0111AM
!{:ev_1} {call e_auto} {comp _dwn,6} {ifco auto,nfa} ;see mark-and-dial area
!{:ev_2} {call e_auto} {comp _dwn,6} {ifco sfa,auto} ;below for these labels
!{:ev_3} {ifex %repdr\*.rep,,nlop} {call e_auto} {goto sf4}
!{:ev_4} {call e_auto} {call alb} {goto auto}
┌────────────────────────┐ ┌───────────────────────┐
│ Links from COMMO.FON │ │ Generic Logon Alone │
└────────────────────────┘ └───────────────────────┘
* By using these three character linked macro names in your .FON directory
* Commo will be able to logon automatically to each of these BBS types.
* These logons will get you as far as the Main Board Command Prompt
* (No mail fetching will occur).
* COMMO.MAC gets some prompt information from TABLE.MAC then jumps
* to the generic logon routine in LOGON.MAC.
{:pcb} {macl table.mac,pcb} ;PCBoard v14.5, v15.0
{:rma} {macl table.mac,rma} ;Remote Access
{:tag} {macl table.mac,tag} ;T.A.G.
{:s-f} {macl table.mac,s-f} ;Spitfire
{:sfh} {macl table.mac,sfh} ;Spitfire, HOTKEY version
{:gap} {macl table.mac,gap} ;GAP
{:wc!} {macl table.mac,wc!} ;Wildcat!
{:mac} {macl table.mac,mac} ;MacroBBS
{:max} {macl table.mac,max} ;Maximus BBS
{:maj} {macl table.mac,maj} ;Major BBS
{:vir} {macl table.mac,vir} ;Virtual BBS
{:exc} {macl table.mac,exc} ;EXEC-PC BBS
┌───────────────────────────────────────────────┐
│ .FON -> COMMO.MAC -> TABLE.MAC -> LOGON.MAC │
└───────────────────────────────────────────────┘
* :qwk is the standard mailrun link to have in your .FON directory.
{:qwk} {macl table.mac,qwk} ;fetch BBS particulars
┌──────────────────────────┐
│ Mark and Dial routines │
└──────────────────────────┘
* These are quite specific to a COMMO.FON dialing directory.
* That's why you need to edit this area.
* Note the use of %m_call% to control dialing sequence. This is required
* because linked dialing macros jump to TABLE.MAC then to LOGON.MAC.
* LOGON.MAC returns to position ":%m_call" in this file (CS-COMMO.MAC).
* If you run on Autopilot, you will probably be calling some of these
* "mark and dial" routines.
! If you don't run Autopilot, all editing is below this line
!{:nfb} {unma} {mark de2,de3} {goto aln}
!{:nf7} {unma} {mark Weather} {goto aln}
!{:nfa} {mark weather}
! {setv m_call,001}
! {setv skip {goto aln}
!{:001} {mark de2,de3}
! {setv skip} {setv m_call,aln} {goto aln}
!{:cfa} {unma} {mark ledge,datawarp} {goto aln}
!{:sfa} {mark de2,de3,smvti,direct,dataw,ledge,babb,after5,foxhole,nodez,dock,lisa},weather,wolf's
! {disp 6,21,1f,║ Weekend! Dial All ■ marked BBS's ║}
! {setv skip} {setv m_call,aln} {goto aln}
!{:sf1} {unma} {mark Node4} {dial 15} {}
!{:sf2} {unma} {mark Director} {dial 15} {}
!{:wtr} {macl weather.mac,wtr}
┌────────────────────────────────────────┐
│ Mail Run Link from .FON to TABLE.MAC │
└────────────────────────────────────────┘
* With this tool you can mark multiple nodes of one BBS but make only one
* connect per BBS. After connecting, the macro unmarks nodes named here.
* After unmarking .FON entries, goto :qwk for routine logon and mail process.
!{:nlb} {unma de2,de3} {goto qwk} ;manipulate .FON