home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / c / commo541.zip / SAMPLES.MAC < prev    next >
Text File  |  1993-02-13  |  8KB  |  195 lines

  1.                   ┌───────────────────────────┐
  2.                   │ Additional Macro Examples │
  3.                   └───────────────────────────┘
  4.  
  5. This file contains a number of sample macros.  Feel free to copy any of them
  6. to COMMO.MAC and to alter them to your own needs.  Additions will be made to
  7. this file as time permits.  Thanks to the users for their contributions.
  8.  
  9. {COMMO} macros can be made to do many amazing things besides just logging into
  10. BBS's and doing mail runs (those are indeed popular functions, however).  Some
  11. of the simplest macros demonstrate this capability.
  12.  
  13.  
  14. The first two macros are used for reading messages.  They use the grey plus
  15. and minus keys in the lower right corner of the keyboard. The first one sends
  16. a <cr>, then clears the screen.  Makes messages a lot easier to read since
  17. each one starts displaying at the top of the screen.  The second macro just
  18. sends a <cr>.  Nice for keyboards without the extra Enter key.
  19.  
  20.  Message reading macros
  21.  ───────────────────────────────────────────────────────────────────────────
  22.  {:gr+} {send |} {clear} {}
  23.  {:gr-} {send |} {}
  24.  
  25.  
  26. The next macro is a very important one.  It shows the basic method of asking
  27. for a filename and uploading the file.  Notice that it first sets the variable
  28. "file" to the upload directory (the variable "uldir").  Then when the INPUt
  29. function executes, the upload directory appears in the input line with a "\".
  30. This macro would execute when Alt-F2 is pressed.
  31.  
  32.  Upload a file using Zmodem (via DSZ)
  33.  ───────────────────────────────────────────────────────────────────────────
  34.  {:af2} {setv file,%uldir\}
  35.         {input file,Enter a filename:}
  36.         {exec-AW DSZ port %_por sz -m %file} {}
  37.  
  38.  
  39.  Start my mail reader after a mail run
  40.  ───────────────────────────────────────────────────────────────────────────
  41.  {:cF3} {exec-ns jabber} {}            JABBER Reader w/swap
  42.  
  43.  
  44. The next two utilities are used in various macros to wait for carrier detect
  45. to drop, then continue dialing (ncr) and to hangup when necessary and continue
  46. dialing (hng):
  47.  
  48.  {:hng}
  49.         {pause 3} {hangup y}
  50.  {:ncr}
  51.         {pause 1} {ifcarrier ncr}
  52.         {pause 5} {dial ,} {beep} {}
  53.  
  54.  
  55. My generic login macro will login to most popular BBS's.  The generic login
  56. subroutine can be called from mail run macros, etc.  The GOLOok with the
  57. ";passwor" ignores the string "password" in the opening instructions on an
  58. Auntie board.  Put {login} in your Dialing Directory macro field.
  59.  
  60.  Generic login macro
  61.  ───────────────────────────────────────────────────────────────────────────
  62.  {:login} {capture y,c:\commo\commo.cap}      RBBS, PCBoard, Auntie, etc.
  63.           {asci ,} {call gls} {}
  64.  
  65.  Generic login subroutine
  66.  ───────────────────────────────────────────────────────────────────────────
  67.   {:gls} {setlook 60,hng,10,|}
  68.          {setv ss_r,~|} {setv ss_yr,~y|}
  69.   {:li1} {sslo ss_r,(enter)}            {sslo ss_yr,graphics (enter)}
  70.          {calo li1,li2,first name}      {calo li1,li3,last name}
  71.          {sslo ss_yr,is this correct}   {golo li1,;passwor}
  72.          {lookfor password}             {send ~%_pas|} {return}
  73.   {:li2} {send ~Fred|}    {return}
  74.   {:li3} {send ~Brucker|} {return}
  75.  
  76.  
  77. Here is a macro using variables to do a mail run on a PCBoard with a MarkMail,
  78. Rosemail or QMail door.  It will upload a reply packet if one exists, delete
  79. the packet if the upload is successful, then log off.  If there is no reply
  80. packet it will download new messages and log off. At the end it will wait for
  81. carrier detect to drop, then continue multi-number dialing.
  82.  
  83. The subroutines "mail_up" and "mail_dn" can be changed to use any protocol.
  84. The supplied ones use the Internal Xmodem-1k.
  85.  
  86. Four variables must be set prior to starting this macro.  These can be set in
  87. the Dialing Directory entry or in the Linked Macro.  For example, to call
  88. Northern Lights and use the QMail door, the Dialing Directory (all on one
  89. line!) would be:
  90.  
  91.   Northern Lights   12/21/91  {1 207 761 4782}  {password} {pcbmail} {} ...
  92.       ... {nodeid,nlbbs} {maildoor,qmail} {nomsgs,sorry, but no} {ptim,2}
  93.  
  94. This will set the variables and go direct to "pcbmail."
  95.  
  96. To use the Linked Macro instead you would have a Dialing Directory entry like:
  97.  
  98.   Northern Lights   12/21/91  {1 207 761 4782}  {password} {northern} {}
  99.  
  100. And then have a Linked Macro such as:
  101.  
  102.   {:northern}
  103.         {setv nodeid,nlbbs}             Set node id
  104.         {setv maildoor,qmail}           Set door type
  105.         {setv nomsgs,sorry, but no}     Set message to LOOKfor if no messages
  106.         {setv ptim,2}                   Set prompt timer duration
  107.         {goto pcbmail}                  GOTO the mail run macro
  108.  
  109.  
  110.  PCBoard generic mailrun
  111.  ───────────────────────────────────────────────────────────────────────────
  112.  {:pcbmail}
  113.          {setv ss_yr,y|}
  114.          {capt y,c:\commo\%nodeid.%_day} {asci ,}
  115.          {setl 30,hng} {look ^g} {call gls}
  116.          {setl 60,hng,%ptim,n|} {look main board command?}
  117.          {setl 120,hng}  ** turn off prompt timer
  118.  
  119.          {send open %maildoor|} {look %maildoor command}
  120.          {ifex %uldir\%nodeid.rep,,mr_dl}  ** if no reply, go to download
  121.  {:mr_ul}
  122.          {send u|} {look %nodeid.rep} {call mail_up}
  123.          {look %maildoor command} {ifcon mr_gb,mr_ul} ** if error, try again
  124.  {:mr_dl}
  125.          {send d|}
  126.          {golo mr_gb,%nomsgs} {sslo ss_yr,when done?}
  127.          {sslo ss_yr,(y/n)} {look %nodeid.qwk}
  128.          {call mail_dn} {look %maildoor command}
  129.          {ifcon ,mr_dl}  ** if error, try again
  130.  {:mr_gb}
  131.          {send g|} {goto hng}
  132.  
  133.  {:mail_dn} {pause 2} {rxmo %dldir\%nodeid.qwk} {comp %_err,0} {return}
  134.  
  135.  {:mail_up} {sxmo-k %uldir\%nodeid.rep} {ifer 1,mu_end}
  136.             {exec-N del %uldir\%nodeid.rep}
  137.  {:mu_end}  {comp %_err,0} {return}
  138.  
  139.  
  140. Here is my mailrun macro for Babble Underground using the MKQwk mail door
  141. under the Remote Access BBS.  The variable "dldir" is used as the disk
  142. directory for downloading the .QWK packet, "uldir" for the .REP.
  143.  
  144.  Babble Underground mail run
  145.  ───────────────────────────────────────────────────────────────────────────
  146.  {:babble}
  147.         {setv ss_y,y} {setv ss_n,n}
  148.         {setv nodeid,babble-u}  ** set board ID
  149.         {capt y,c:\commo\%nodeid.%_day} {asci ,}
  150.         {setl 60,hng}
  151.         {look escape twice} {send ^[^[}  ** for Front Door
  152.         {look real name?} {send Fred Brucker|}  <<-- Your name here
  153.         {look password:} {send %_pas|}
  154.         {sslo ss_n,y/n}
  155.         {look command:} {send q}  ** open .QWK door
  156.         {look command:}
  157.         {ifex %uldir\%nodeid.rep,,bu_dl}  ** if no reply, go to download
  158.  {:bu_ul}
  159.         {send u}
  160.         {sslo ss_y,yes/no}
  161.         {look transfer now}
  162.         {call mail_up}
  163.         {look command:} {send g~y}
  164.         {pause 2} {goto hng}
  165.  {:bu_dl}
  166.         {setl 600,hng}   ** set timeout for download
  167.         {send d}
  168.         {sslo ss_y,yes/no}
  169.         {golo hng,no messages found}
  170.         {look transfer now}
  171.         {call mail_dn}
  172.         {pause 5} {goto hng}
  173.  
  174.  
  175. Here is my online quoting macro.  It saves the Screen Image File pathname in
  176. the variable "scrsav."
  177.  
  178. Then it sets the Screen Image File to a temporary file and goes into
  179. Scrollback.  In Scrollback I write a block of text to disk (the quote), then
  180. exit.  My editor (QEdit) is then executed on the temporary file.  I do what I
  181. need there to dress up the quote (like add quoting marks, etc.).  When I save
  182. the file and exit the editor, the macro does an ASCII Upload of the file and
  183. deletes it.
  184.  
  185. Then the Screen Image pathname is restored to what it was before.
  186.  
  187.  Quoting macro
  188.  ───────────────────────────────────────────────────────────────────────────
  189.  {:cf6} {setv scrsav,%_scr} {screen n,%dldir\temp} {scroll}
  190.         {exec-N q %_scr} {asci %_scr}
  191.         {exec-N del %_scr} {screen n,%scrsav} {}
  192.  
  193.  
  194.                                 - end -
  195.