home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / COMM / MISC / COMMO52.ZIP / SAMPLES.MAC < prev    next >
Encoding:
Text File  |  1992-03-07  |  9.2 KB  |  240 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.  
  31.  Upload a file using Zmodem (via DSZ)
  32.  ───────────────────────────────────────────────────────────────────────────
  33.  {:af2} {setv file,%uldir\}
  34.         {input file,Enter a filename:}
  35.         {exec-AW DSZ port %_por sz -m %file} {}
  36.  
  37.  
  38.  Start my mail reader after a mail run
  39.  ───────────────────────────────────────────────────────────────────────────
  40.  {:cF3} {exec-N jabber} {}            JABBER Reader
  41.  
  42.  
  43. The next two utilities are used in various macros to wait for carrier detect
  44. to drop, then continue dialing (ncr) and to hangup when necessary and continue
  45. dialing (hng):
  46.  
  47.  {:hng}
  48.         {pause 3} {hangup y}
  49.  {:ncr}
  50.         {pause 1} {ifcarrier ncr}
  51.         {pause 5} {dial ,} {beep} {}
  52.  
  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.   {:li1} {calo li1,li2,(enter)}         {calo li1,li3,graphics (enter)}
  69.          {calo li1,li4,first name}      {calo li1,li5,last name}
  70.          {calo li1,li3,is this correct} {golo li1,;passwor}
  71.          {lookfor password}             {send ~%_pas|} {return}
  72.   {:li2} {send ~|}        {return}
  73.   {:li3} {send ~y|}       {return}
  74.   {:li4} {send ~Fred|}    {return}
  75.   {:li5} {send ~Brucker|} {return}
  76.  
  77.  
  78. Here is a macro using variables to do a mail run on a PCBoard with a MarkMail,
  79. Rosemail or QMail door.  It will upload a reply packet if one exists, delete
  80. the packet if the upload is successful, then log off.  If there is no reply
  81. packet it will download new messages and log off. At the end it will wait for
  82. carrier detect to drop, then continue multi-number dialing.
  83.  
  84. The subroutines "mail_up" and "mail_dn" can be changed to use any protocol.
  85. The supplied ones use the Internal Xmodem-1k.
  86.  
  87. Four variables must be set prior to starting this macro.  These can be set in
  88. Dialing Directory entry or in the Linked Macro.  For example, to call Northern
  89. Lights and use the QMail door, the Dialing Directory (all on one line!) would
  90. be:
  91.  
  92.   Northern Lights   12/21/91  {1 207 761 4782}  {password} {pcbmail} {} ...
  93.       ... {nodeid,nlbbs} {maildoor,qmail} {nomsgs,sorry, but no} {ptim,2}
  94.  
  95. This will set the variables and go direct to "pcbmail."
  96.  
  97. To use a Linked Macro instead you would have a Dialing Directory entry like:
  98.  
  99.   Northern Lights   12/21/91  {1 207 761 4782}  {password} {northern} {}
  100.  
  101. And then have a Linked Macro such as:
  102.  
  103.   {:northern}
  104.         {setv nodeid,nlbbs}             Set node id
  105.         {setv maildoor,qmail}           Set door type
  106.         {setv nomsgs,sorry, but no}     Set message to LOOKfor if no messages
  107.         {setv ptim,2}                   Set prompt timer duration
  108.         {goto pcbmail}                  GOTO the mail run macro
  109.  
  110.  
  111.  PCBoard generic mailrun
  112.  ───────────────────────────────────────────────────────────────────────────
  113.  {:pcbmail}
  114.          {capt y,c:\commo\%nodeid.%_day} {asci ,}
  115.          {setl 30,hng} {look ^g} {call gls}
  116.          {setl 60,hng,%ptim,n|} {look 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.  {:mr_dl1}
  127.          {golo mr_gb,%nomsgs} {calo mr_dl1,mr_sy,when done?} 
  128.          {calo mr_dl1,mr_sy,(y/n)} {look %nodeid.qwk}
  129.          {call mail_dn} {look %maildoor command}
  130.          {ifcon ,mr_dl}  ** if error, try again
  131.  {:mr_gb}
  132.          {send g|} {goto hng}
  133.  {:mr_sy}
  134.          {send y|} {return}
  135.  
  136.  {:mail_dn} {pause 2} {rxmo %dldir\%nodeid.qwk} {comp %_err,0} {return}
  137.  
  138.  {:mail_up} {sxmo-k %uldir\%nodeid.rep} {ifer 1,mu_end}
  139.             {exec-N del %uldir\%nodeid.rep}
  140.  {:mu_end}  {comp %_err,0} {return}
  141.  
  142.  
  143. Here is my mailrun macro for Babble Underground using the MKQwk mail door for
  144. Remote Access.  The variable "dldir" is used as the disk directory for
  145. downloading the .QWK packet, "uldir" for the .REP.
  146.  
  147.  Babble Underground mail run
  148.  ───────────────────────────────────────────────────────────────────────────
  149.  {:babble}
  150.         {setv nodeid,babble-u}  ** set board ID
  151.         {capt y,c:\commo\%nodeid.%_day} {asci ,}
  152.         {setl 60,hng}
  153.         {look escape twice} {send ^[^[}  ** for Front Door
  154.         {look real name?} {send Fred Brucker|}  <<-- Your name here
  155.         {look password:} {send %_pas|}
  156.  {:bu_lk1}
  157.         {calo bu_lk1,bu_n,y/n}
  158.         {look command:} {send q}  ** open .QWK door
  159.         {look command:}
  160.         {ifex %uldir\%nodeid.rep,,bu_dl}  ** if no reply, go to download
  161.  {:bu_ul}
  162.         {send u}
  163.  {:bu_lk2}
  164.         {calo bu_lk2,bu_y,yes/no}
  165.         {look transfer now}
  166.         {call mail_up}
  167.         {look command:} {send g~y}
  168.         {pause 2} {goto hng}
  169.  {:bu_dl}
  170.         {setl 600,hng}   ** set timeout for download
  171.         {send d}
  172.  {:bu_lk3}
  173.         {calo bu_lk3,bu_y,yes/no}
  174.         {golo hng,no messages found}
  175.         {look transfer now}
  176.         {call mail_dn}
  177.         {pause 5} {goto hng}
  178.  
  179.  {:bu_y}
  180.         {send y} {return}
  181.  {:bu_n}
  182.         {send n} {return}
  183.  
  184.  
  185. This is my mail run macro for Directory Assistance using the JIMMER RBBS mail
  186. door.  If a reply packet exists, it will be uploaded.  If there is no reply
  187. packet it will download the new messages.
  188.  
  189.  Directory Assistance mail run
  190.  ───────────────────────────────────────────────────────────────────────────
  191.  {:damail}
  192.          {setv nodeid,dirasnt}
  193.          {unmark 3dir 2dir}  ** unmark directory entries
  194.          {capt y,\commo\dir.%_day} {asci ,}
  195.          {setl 60,hng}
  196.          {golo ncr,no carrier}
  197.          {look =-=-=-=-=-}
  198.          {setl 60,hng,3,n|}
  199.          {look first name} {send fred;brucker;%_pass%;!main|}
  200.          {golo ncr,no carrier}
  201.          {look your command} {send open jimmer|}
  202.          {setl 60,hng}
  203.          {call dm3}
  204.          {ifex %uldir\%nodeid.rep,,dm1}
  205.  {:dm0}  {send u|} {look %nodeid.rep} {call mail_up}
  206.          {call dm3} {ifcon ,dm0} {send g|} {goto dm2}
  207.  {:dm1}  {send d|}
  208.          {golo hng,no messages to download}
  209.          {golo hng,you must select}
  210.          {setl 300,hng}
  211.          {look %nodeid.qwk} {call mail_dn}
  212.          {call dm3} {ifcon ,dm1}
  213.  {:dm2}  {send g|} {look slam!} {goto hng}
  214.  
  215.  {:dm3}  {calo dm3,dm4,to continue>}
  216.          {golo ncr,no carrier}
  217.          {look your selection} {return}
  218.  {:dm4}  {send |} {return}
  219.  
  220.  
  221.  Here's my latest whizbang quoting macro.  It saves the Screen Image File
  222.  pathname in the variable "scrsav."
  223.  
  224.  Then it sets the Screen Image File to a temporary file and goes into
  225.  Scrollback.  In Scrollback I write a block of text to disk (the quote), then
  226.  exit.  My editor (QEdit) is then executed on the temporary file.  I do what I
  227.  need there to dress up the quote (like add quoting marks, etc.).  When I save
  228.  the file and exit the editor, the macro does an ASCII Upload of the file and
  229.  deletes it.
  230.  
  231.  Then the Screen Image pathname is restored to what it was before.
  232.  
  233.  Quoting macro
  234.  ───────────────────────────────────────────────────────────────────────────
  235.  {:cf6} {setv scrsav,%_scr} {screen n,%dldir\temp} {scroll}
  236.         {exec-N q %_scr} {asci %_scr}
  237.         {exec-N del %_scr} {screen n,%scrsav} {}
  238.  
  239.                                 - end -
  240.