home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 24 DOS / 24-DOS.zip / commo60.zip / SAMPLES.MAC < prev    next >
Text File  |  1994-04-09  |  11KB  |  276 lines

  1.                   ┌───────────────────────────┐
  2.                   │ Additional Macro Examples │
  3.                   └───────────────────────────┘
  4.  
  5. This file contains a number of sample macros.  They will need to be modified
  6. to work for you.  Feel free to copy any of them to COMMO.MAC or to an
  7. auxiliary Macro File and to alter them to your own needs.  Additions will be
  8. made to this file as time permits.  Thanks to the users for their
  9. contributions.
  10.  
  11. {COMMO} macros can be made to do many amazing things besides just logging into
  12. BBS's and doing mail runs (those are indeed popular functions, however).  Some
  13. of the simplest macros demonstrate this capability.
  14.  
  15.  
  16. The first two macros are used for reading messages online.  They use the grey
  17. plus and minus keys in the lower right corner of the keyboard.  The first one
  18. sends a <cr>, then clears the screen.  Makes messages a lot easier to read
  19. since each one starts displaying at the top of the screen.  The second macro
  20. just sends a <cr>.  Nice for keyboards without the extra Enter key.
  21.  
  22.  Message reading macros
  23.  ───────────────────────────────────────────────────────────────────────────
  24.  {:gr+} {send |} {clear} {}
  25.  {:gr-} {send |} {}
  26.  
  27.  
  28. The next macro is a very important one.  It shows the basic method of asking
  29. for a filename and uploading the file.  Notice that it first sets the variable
  30. "pr_file" to the upload directory (the variable "uldir").  Then when the INPUt
  31. function executes, the upload directory appears in the input line with a "\".
  32. This macro would execute when Alt-F2 is pressed.
  33.  
  34.  Upload a file using Zmodem
  35.  ───────────────────────────────────────────────────────────────────────────
  36.  {:af2} {setv pr_file,%uldir\}
  37.         {input pr_file,Enter a filename:}
  38.         {setv pr_alarm}
  39.         {call z_send} {}
  40.  
  41.  
  42.  Start my mail reader after a mail run
  43.  ───────────────────────────────────────────────────────────────────────────
  44.  {:cF3} {exec-ns tse /esqinit} {}            SemQWK Reader w/swap
  45.  
  46.  
  47. The next two utilities are used in various macros to wait for carrier detect
  48. to drop, then continue dialing (ncr) and to hangup when necessary and continue
  49. dialing (hng):
  50.  
  51.  {:hng}
  52.         {pause 3} {hangup y}
  53.  {:ncr}
  54.         {pause 1} {ifcarrier ncr}
  55.         {pause 5} {dial ,} {beep} {}
  56.  
  57.  
  58. My generic login macro will login to most popular BBS's.  The generic login
  59. subroutine can be called from mail run macros, etc.  The GOLOok with the
  60. ";passwor" ignores the string "password" in the opening instructions on an
  61. Auntie board.  Put {login} in your Dialing Directory macro field.
  62.  
  63.  Generic login macro
  64.  ───────────────────────────────────────────────────────────────────────────
  65.  {:login} {capture y,c:\commo\commo.cap}      RBBS, PCBoard, Auntie, etc.
  66.           {asci ,} {call gls} {}
  67.  
  68.  Generic login subroutine
  69.  ───────────────────────────────────────────────────────────────────────────
  70.   {:gls} {setlook 60,hng,10,|}
  71.          {setv ss_r,~|} {setv ss_yr,~y|}
  72.   {:li1} {sslo ss_r,(enter)}            {sslo ss_yr,graphics (enter)}
  73.          {calo li1,li2,first name}      {calo li1,li3,last name}
  74.          {sslo ss_yr,is this correct}   {golo li1,;passwor}
  75.          {lookfor password}             {send ~%_pas|} {return}
  76.   {:li2} {send ~First|} {return}
  77.   {:li3} {send ~Last|} {return}
  78.  
  79.  
  80. Here is a macro using variables to do a mail run on a PCBoard with a MarkMail,
  81. Rosemail or QMail door.  It will upload a reply packet if one exists, delete
  82. the packet if the upload is successful, then log off.  If there is no reply
  83. packet it will download new messages and log off. At the end it will wait for
  84. carrier detect to drop, then continue multi-number dialing.
  85.  
  86. The subroutines "mail_up" and "mail_dn" can be changed to use any protocol.
  87. The supplied ones use the Internal Xmodem-1k.
  88.  
  89. Four variables must be set prior to starting this macro.  These can be set in
  90. the Dialing Directory entry or in the Linked Macro.  For example, to call
  91. Northern Lights and use the QMail door, the Dialing Directory (all on one
  92. line!) would be:
  93.  
  94.   Northern Lights   12/21/91  {1 207 761 4782}  {password} {pcbmail} {} ...
  95.       ... {bbsid,nlbbs} {maildoor,qmail} {nomsgs,sorry, but no} {ptim,2}
  96.  
  97. This will set the variables and go direct to "pcbmail."
  98.  
  99. To use the Linked Macro instead you would have a Dialing Directory entry like:
  100.  
  101.   Northern Lights   12/21/91  {1 207 761 4782}  {password} {northern} {}
  102.  
  103. And then have a Linked Macro such as:
  104.  
  105.   {:northern}
  106.         {setv bbsid,nlbbs}              Set bbs id
  107.         {setv maildoor,qmail}           Set door type
  108.         {setv nomsgs,sorry, but no}     Set message to LOOKfor if no messages
  109.         {setv ptim,2}                   Set prompt timer duration
  110.         {goto pcbmail}                  GOTO the mail run macro
  111.  
  112.  
  113.  PCBoard generic mailrun
  114.  ───────────────────────────────────────────────────────────────────────────
  115.  {:pcbmail}
  116.          {setv ss_yr,y|}
  117.          {capt y,c:\commo\%bbsid.%_day} {asci ,}
  118.          {setl 30,hng} {golo ,pcboard (r)}
  119.          {look ^g} {call gls}
  120.          {setl 60,hng,%ptim,n|} {look main board command?}
  121.          {setl 120,hng}  ** turn off prompt timer
  122.  
  123.          {send open %maildoor|} {look %maildoor command}
  124.          {ifex %uldir\%bbsid.rep,,mr_dl}  ** if no reply, go to download
  125.  {:mr_ul}
  126.          {send u|} {look %bbsid.rep} {call mail_up}
  127.          {look %maildoor command} {ifcon mr_gb,mr_ul} ** if error, try again
  128.  {:mr_dl}
  129.          {send d|}
  130.          {golo mr_gb,%nomsgs} {sslo ss_yr,when done?}
  131.          {sslo ss_yr,(y/n)} {look %bbsid.qwk}
  132.          {call mail_dn} {look %maildoor command}
  133.          {ifcon ,mr_dl}  ** if error, try again
  134.  {:mr_gb}
  135.          {send g|} {goto hng}
  136.  
  137.  {:mail_dn}     ** rename .QWK packets
  138.         {ifex c:\mail\store\%bbsid.qwk,,mail_dn1}
  139.         {exec-n del c:\mail\store\%bbsid.1 > nul}
  140.         {exec-n ren c:\mail\store\%bbsid.2 %bbsid.1 > nul}
  141.         {exec-n ren c:\mail\store\%bbsid.3 %bbsid.2 > nul}
  142.         {exec-n ren c:\mail\store\%bbsid.4 %bbsid.3 > nul}
  143.         {exec-n ren c:\mail\store\%bbsid.5 %bbsid.4 > nul}
  144.         {exec-n ren c:\mail\store\%bbsid.qwk %bbsid.5 > nul}
  145.  {:mail_dn1}
  146.         {pause 2}
  147.         {setv pr_down,c:\mail\store}
  148.         {setv pr_alarm,0}
  149.         {call yg_recv}    Ymodem-G (change to z_recv for Zmodem)
  150.         {ifer 1,,mail_dn2}
  151.         {exec-n del c:\mail\store\%bbsid.qwk}
  152.  {:mail_dn2}
  153.         {return}
  154.  
  155.  {:mail_up}
  156.         {setv pr_file,%uldir\%bbsid.rep}
  157.         {setv pr_alarm,0}
  158.         {call yb_send}    Ymodem (change to z_send for Zmodem)
  159.         {ifer 1,mail_up1}
  160.         {exec-N del %uldir\%bbsid.rep}
  161.  {:mail_up1}
  162.         {comp %_err,0} {return}
  163.  
  164.  
  165. The following macro does a mail run on most WildCat! BBS's with the TomCat!
  166. mail door.  The only variables that need to be set are "bbsid" and "ptim."
  167. The "ss_" variables may be set in the Setup File (using the "set" keyword).
  168.  
  169.  
  170.  ** WildCat! generic mailrun
  171.  ───────────────────────────────────────────────────────────────────────────
  172.  {:catmail}
  173.         {setv ss_ee,~^[^[}
  174.         {setv ss_r,~|}
  175.         {setv ss_y,~y}
  176.         {setv ss_n,~n}
  177.         {setv ss_bday,~mm-dd-yy|}      <- your birthdate
  178.         {setv ss_pnum,~614-326-1309|}  <- your phone number
  179.         {setv ss_name,~First Last|}    <- your name
  180.  
  181.         {capt y,c:\commo\%bbsid.%_day} {asci ,}
  182.         {setl 60,hng}
  183.         {sslo ss_ee,twice}
  184.         {sslo ss_name,first name}
  185.         {look password?} {send %_pas|}
  186.         {setl 60,hng,%ptim,|}
  187.         {sslo ss_r,[c]ontinue}
  188.         {sslo ss_r,[enter]}
  189.         {sslo ss_n,choice? [ ]}
  190.         {sslo ss_bday,birth date}
  191.         {sslo ss_pnum,phone number}
  192.         {sslo ss_n,bulletin menu?}
  193.         {look main menu} {send ~~m}
  194.         {look message menu} {send ~~d}
  195.         {setl 120,hng}  ** turn off prompt timer
  196.         {look tomcat menu}
  197.  {:wc_dl}
  198.         {pause 1} {send d}
  199.  {:wc_dl1}
  200.         {sslo ss_y,receive this packet}
  201.         {golo wc_dl2,nothing found}
  202.         {look %bbsid.qwk}
  203.         {call mail_dn}
  204.         {look tomcat menu}
  205.         {ifcon wc_ul,wc_dl}  ** if error, try again
  206.  {:wc_dl2}
  207.         {look tomcat menu}
  208.  {:wc_ul}
  209.         {ifex %uldir\%bbsid.rep,,wc_bye}  ** if no reply, done
  210.         {pause 1} {send u}
  211.  {:wc_ul1}
  212.         {look %bbsid.rep}
  213.         {call mail_up}
  214.         {look tomcat menu}
  215.         {ifcon ,wc_ul}  ** if error, try again
  216.  {:wc_bye}
  217.         {pause 1} {send g} {goto hng}
  218.  
  219.  
  220. Here is my mailrun macro for Babble Underground using the MKQwk mail door
  221. under the Remote Access BBS.  The variable "dldir" is used as the disk
  222. directory for downloading the .QWK packet, "uldir" for the .REP.
  223.  
  224.  
  225.  Babble Underground mail run
  226.  ───────────────────────────────────────────────────────────────────────────
  227.  {:babble}
  228.         {setv ss_y,y} {setv ss_n,n}
  229.         {setv bbsid,babble-u}  ** set board ID
  230.         {capt y,c:\commo\%bbsid.%_day} {asci ,}
  231.         {setl 60,hng}
  232.         {look escape twice} {send ^[^[}  ** for Front Door
  233.         {look real name?} {send First Last|}  <<-- Your name here
  234.         {look password:} {send %_pas|}
  235.         {sslo ss_n,y/n}
  236.         {look command:} {send q}  ** open .QWK door
  237.         {look command:}
  238.         {ifex %uldir\%bbsid.rep,,bu_dl}  ** if no reply, go to download
  239.  {:bu_ul}
  240.         {send u}
  241.         {sslo ss_y,yes/no}
  242.         {look transfer now}
  243.         {call mail_up}
  244.         {look command:} {send g~y}
  245.         {pause 2} {goto hng}
  246.  {:bu_dl}
  247.         {setl 600,hng}   ** set timeout for download
  248.         {send d}
  249.         {sslo ss_y,yes/no}
  250.         {golo hng,no messages found}
  251.         {look transfer now}
  252.         {call mail_dn}
  253.         {pause 5} {goto hng}
  254.  
  255.  
  256. Here is my online quoting macro.  It saves the Screen Image File pathname in
  257. the variable "scrsav."
  258.  
  259. Then it sets the Screen Image File to a temporary file and goes into
  260. Scrollback.  In Scrollback I write a block of text to disk (the quote), then
  261. exit.  My editor (QEdit) is then executed on the temporary file.  I do what I
  262. need there to dress up the quote (like add quoting marks, etc.).  When I save
  263. the file and exit the editor, the macro does an ASCII Upload of the file and
  264. deletes it.
  265.  
  266. Then the Screen Image pathname is restored to what it was before.
  267.  
  268.  Quoting macro
  269.  ───────────────────────────────────────────────────────────────────────────
  270.  {:cf6} {setv scrsav,%_scr} {screen n,%dldir\temp} {scroll}
  271.         {exec-N q %_scr} {asci %_scr}
  272.         {exec-N del %_scr} {screen n,%scrsav} {}
  273.  
  274.  
  275.                                 - end -
  276.