home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / comm / commo551.zip / SAMPLES.MAC < prev    next >
Text File  |  1993-08-07  |  10KB  |  250 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. The following macro does a mail run on most WildCat! BBS's with the TomCat!
  141. mail door.  The only variables that need to be set are "bbsid" and "ptim."
  142. The "ss_" variables may be set in the Setup File (using the "set" keyword).
  143.  
  144.  
  145.  ** WildCat! generic mailrun
  146.  ───────────────────────────────────────────────────────────────────────────
  147.  {:catmail}
  148.         {setv ss_r,|}
  149.         {setv ss_y,y}
  150.         {setv ss_n,n}
  151.         {setv ss_bday,mm-dd-yy|}      <- your birthdate
  152.         {setv ss_pnum,614-326-1309|}  <- your phone number
  153.         {setv ss_name,First Last|}    <- your name
  154.  
  155.         {capt y,c:\commo\%bbsid.%_day} {asci ,}
  156.         {setl 60,hng}
  157.         {sslo ss_ee,twice} {send ~~^[^[}
  158.         {sslo ss_name,first name}
  159.         {look password?} {send %_pas|}
  160.         {setl 60,hng,%ptim,|}
  161.         {sslo ss_r,[c]ontinue}
  162.         {sslo ss_r,[enter]}
  163.         {sslo ss_n,choice? [ ]}
  164.         {sslo ss_bday,birth date}
  165.         {sslo ss_pnum,phone number}
  166.         {sslo ss_n,bulletin menu?}
  167.         {look main menu} {send ~~m}
  168.         {look message menu} {send ~~d}
  169.         {setl 120,hng}  ** turn off prompt timer
  170.         {look tomcat menu}
  171.  {:wc_dl}
  172.         {pause 1} {send d}
  173.  {:wc_dl1}
  174.         {sslo ss_y,receive this packet}
  175.         {golo wc_dl2,nothing found}
  176.         {look %bbsid.qwk}
  177.         {call mail_dn}
  178.         {look tomcat menu}
  179.         {ifcon wc_ul,wc_dl}  ** if error, try again
  180.  {:wc_dl2}
  181.         {look tomcat menu}
  182.  {:wc_ul}
  183.         {ifex %uldir\%bbsid.rep,,wc_bye}  ** if no reply, done
  184.         {pause 1} {send u}
  185.  {:wc_ul1}
  186.         {look %bbsid.rep}
  187.         {call mail_up}
  188.         {look tomcat menu}
  189.         {ifcon ,wc_ul}  ** if error, try again
  190.  {:wc_bye}
  191.         {pause 1} {send g} {goto hng}
  192.  
  193.  
  194. Here is my mailrun macro for Babble Underground using the MKQwk mail door
  195. under the Remote Access BBS.  The variable "dldir" is used as the disk
  196. directory for downloading the .QWK packet, "uldir" for the .REP.
  197.  
  198.  
  199.  Babble Underground mail run
  200.  ───────────────────────────────────────────────────────────────────────────
  201.  {:babble}
  202.         {setv ss_y,y} {setv ss_n,n}
  203.         {setv nodeid,babble-u}  ** set board ID
  204.         {capt y,c:\commo\%nodeid.%_day} {asci ,}
  205.         {setl 60,hng}
  206.         {look escape twice} {send ^[^[}  ** for Front Door
  207.         {look real name?} {send Fred Brucker|}  <<-- Your name here
  208.         {look password:} {send %_pas|}
  209.         {sslo ss_n,y/n}
  210.         {look command:} {send q}  ** open .QWK door
  211.         {look command:}
  212.         {ifex %uldir\%nodeid.rep,,bu_dl}  ** if no reply, go to download
  213.  {:bu_ul}
  214.         {send u}
  215.         {sslo ss_y,yes/no}
  216.         {look transfer now}
  217.         {call mail_up}
  218.         {look command:} {send g~y}
  219.         {pause 2} {goto hng}
  220.  {:bu_dl}
  221.         {setl 600,hng}   ** set timeout for download
  222.         {send d}
  223.         {sslo ss_y,yes/no}
  224.         {golo hng,no messages found}
  225.         {look transfer now}
  226.         {call mail_dn}
  227.         {pause 5} {goto hng}
  228.  
  229.  
  230. Here is my online quoting macro.  It saves the Screen Image File pathname in
  231. the variable "scrsav."
  232.  
  233. Then it sets the Screen Image File to a temporary file and goes into
  234. Scrollback.  In Scrollback I write a block of text to disk (the quote), then
  235. exit.  My editor (QEdit) is then executed on the temporary file.  I do what I
  236. need there to dress up the quote (like add quoting marks, etc.).  When I save
  237. the file and exit the editor, the macro does an ASCII Upload of the file and
  238. deletes it.
  239.  
  240. Then the Screen Image pathname is restored to what it was before.
  241.  
  242.  Quoting macro
  243.  ───────────────────────────────────────────────────────────────────────────
  244.  {:cf6} {setv scrsav,%_scr} {screen n,%dldir\temp} {scroll}
  245.         {exec-N q %_scr} {asci %_scr}
  246.         {exec-N del %_scr} {screen n,%scrsav} {}
  247.  
  248.  
  249.                                 - end -
  250.