home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / v611docs.zip / VMAIN611.ZIP / VC10-AJ < prev    next >
Text File  |  1993-10-08  |  13KB  |  296 lines

  1.                                             VBBS 6.11 Documentation -- 10-J-1
  2.  
  3.  
  4.          ╔════════════════════════════════════════════════════════════════╗
  5.          ║  CHAPTER TEN ANNEX J     SCRIPT EXAMPLES & EXPLANATIONS        ║
  6.          ╚════════════════════════════════════════════════════════════════╝
  7.  
  8.          ╔════════════════════════════════════════════════════════════════╗
  9.          ║ Note:  While all the following scripts were written by other   ║
  10.          ║        authors they have all undergone modification to improve ║
  11.          ║        their clarity and/or add in new features found in 6.11. ║
  12.          ║        The first few scripts are general examples, while the   ║
  13.          ║        later group of scripts are specific examples of some of ║
  14.          ║        the more complex scripting command sequences.           ║
  15.          ╚════════════════════════════════════════════════════════════════╝
  16.  
  17.           Question: How do I figure out if it is a user's birthday?
  18.           Answer: Place this section of code into the script that you
  19.                   wish to have show the birthday greeting.
  20.  
  21.            !=============================================================
  22.            !                       Unknown Author
  23.            !=============================================================
  24.            $bmonth = $birthdate LEFT 2
  25.            $month = $date LEFT 2
  26.            $bday = $birthdate MID 4 LEFT 2
  27.            $day = $date MID 4 LEFT 2
  28.            TESTVAL $bmonth <> $month NOTNOW
  29.            IFVAL $bday = $day THEN
  30.               <place your birthday message here>
  31.            ENDIF
  32.            # NOTNOW
  33.            !=============================================================
  34.  
  35.           Question: I would like to know when I have new messages to be
  36.                     validated for my networked subs when I log on.
  37.           Answer: Place this section of code into your START.V file
  38.                   anywhere before you exit.
  39.  
  40.            !=============================================================
  41.            !          Originally written by Ken 1@8051 VirtualNET
  42.            !=============================================================
  43.            testval $security < 254 nothere
  44.            $found = "VALIDATE.0"
  45.            findfirst $validmsg "c:\vbbs\data\validate.0"
  46.            test $validmsg <> $found nothere
  47.            # again
  48.            tr
  49.            getny $choice " 5New messages to VALIDATE. 6 Validate Now? "
  50.            if $choice = "Y" then
  51.               validate
  52.            endif
  53.            # NOTHERE
  54.            !=============================================================
  55.            !    Note:  This ONLY works for VirtualNET message bases.
  56.            !=============================================================
  57.  
  58.  
  59.                                             VBBS 6.11 Documentation -- 10-J-2
  60.  
  61.  
  62.           Question: How do I set up a simple downloads area for special
  63.                     files like virus scanners and compression utilities?
  64.           Answer: Just edit the following script to show the correct paths
  65.                   and filenames for the files, add in the command to run
  66.                   the script from a function block (ex: G 001 2 SHOPPING).
  67.                   Then all you need to do is create a .MNU file (or a .ANS
  68.                   and .ASC pair) listing the user's choices and place it
  69.                   into your \TXT directory and away you go.
  70.  
  71.            !=============================================================
  72.            !        Originally written by O. F. 1@2056 VirtualNET
  73.            !=============================================================
  74.            Example SHOP.MNU file:
  75.  
  76.                         Available files for quick download are:
  77.                A> ARJ230.EXE    - Newest ARJ Compression Utility
  78.                C> CLEAN102.ZIP  - McAfee Virus Cleaning Utility
  79.                F> FRIES.GIF     - GIF of the lovable '-fries'
  80.                G> GREMLIN.GIF   - GIF of 'The (verbose tagline) Gremlin'
  81.                P> PKZIP204G.EXE - Newest PKZip Compression Utility
  82.                S> SCAN102.ZIP   - McAfee Virus Scanning Utility
  83.  
  84.            !=============================================================
  85.            tr $crlf
  86.            menu shop
  87.            tr $crlf
  88.            rr $selection acfgpsq "Which file would you like ? <Q to quit>"
  89.            IF $selection = a THEN
  90.               DOWNLOAD d:\dloads\compress\arj230.exe
  91.            ELSE
  92.            IF $selection = c THEN
  93.               DOWNLOAD d:\dloads\virus\clean102.zip
  94.            ELSE
  95.            IF $selection = f THEN
  96.               DOWNLOAD d:\dloads\gifs\fries.gif
  97.            ELSE
  98.            IF $selection = g THEN
  99.               DOWNLOAD d:\dloads\gifs\gremlin.gif
  100.            ELSE
  101.            IF $selection = p THEN
  102.               DOWNLOAD d:\dloads\compress\pkz204g.exe
  103.            ELSE
  104.            IF $selection = s THEN
  105.               DOWNLOAD d:\dloads\virus\scan102.zip
  106.            ENDIF
  107.            tr $crlf
  108.            exit start
  109.            ! Make sure the EXIT command above is to a .FB you have !!
  110.            !=============================================================
  111.  
  112.  
  113.                                             VBBS 6.11 Documentation -- 10-J-3
  114.  
  115.  
  116.           Question: How can I enhance the chat call from my users?  I like
  117.                     to know WHY they chatted me, even if I am not around.
  118.           Answer: All you have to do is compile the following script as
  119.                   CHAT.V and then and change the line in your START.FB from
  120.                   'l 001 1 ^pagesysop' to 'l 001 2 chat'.
  121.  
  122.            !=============================================================
  123.            !     Originally written by B. B. Woof 1@5096 VirtualNET
  124.            !=============================================================
  125.            tr "Why do you wish to page " $sysop
  126.            tr
  127.            tr "   >----------------------------------------------------<"
  128.            rs $reason "=> "
  129.            tr "   >----------------------------------------------------<"
  130.            test $reason = "" end
  131.            $tst = $reason LEFT 5
  132.            test $tst = "     " end
  133.            test $available = Y imhere
  134.            tr
  135.            tr $sysop " is not currently available, "
  136.            go feed
  137.            # imhere
  138.            tr
  139.            tr "Paging " $sysop
  140.            do $count = 1 10
  141.                ts " 2< 6< 2< 6* 2> 6> 2> " $bell
  142.            loop
  143.            tr
  144.            tr " Please wait 10 seconds for " $sysop " to respond, "
  145.            tr
  146.            drawwaitbar 10
  147.            do $a = 1 10
  148.               ts "*"
  149.               delay 1
  150.            loop
  151.            tr
  152.            tr $sysop " doesn't seem to be answering..."
  153.            # feed
  154.            getyn $yn "Would you like to leave feedback? (Y/N/enter=yes)"
  155.            tr
  156.            if $yn = Y then
  157.               $s = "     and left feedback as well!"
  158.               feedback
  159.            else
  160.               $s = "     and did not leave feedback!"
  161.            endif
  162.            log $handle ", paged you at " $time " on " $date
  163.            log "Chat reason: " $reason
  164.            log $s
  165.            tr
  166.            # end
  167.            exit start
  168.            ! Make sure the EXIT command above is to a .FB you have !!
  169.            !=============================================================
  170.  
  171.  
  172.                                             VBBS 6.11 Documentation -- 10-J-4
  173.  
  174.  
  175.            !==============================================================
  176.            !     Buffer Example (see Section 5 for command descriptions)
  177.            !==============================================================
  178.            ! EMAIL.V   This sends an E-mail to the Sysop.  To do this we
  179.            !           create a form letter in the buffer and then write
  180.            !           the buffer contents to an E-mail addressed to the
  181.            !           Sysop #1 account.  Note the '!' are comment lines.
  182.            !
  183.            !                     Create the form letter
  184.            $Line1 = $Sysop & ","
  185.            $Line2 = "  I'm a new user and would really appreciate it"
  186.            $Line3 = "if you would validate my account."
  187.            $Line4 = "  Thanks!"
  188.            $Line5 = "     " & $Handle
  189.            !                     Clear out any existing buffer contents
  190.            Buffer Clear
  191.            !                     Write the text lines to the Buffer
  192.            Buffer Append $Line1
  193.            Buffer Append $Line2
  194.            Buffer Append $Line3
  195.            Buffer Append $Line4
  196.            Buffer Append $Line5
  197.            !                     Position to the E-mail database
  198.            SetEmail
  199.            !                     Save the buffer as E-mail to the sysop #1
  200.            Save 1 $Node "Validation Request" 0 "" 1
  201.            !                     Clear out the buffer again
  202.            Buffer Clear
  203.            !==============================================================
  204.  
  205.  
  206.                                             VBBS 6.11 Documentation -- 10-J-5
  207.  
  208.  
  209.            !==============================================================
  210.            !     File Editing Example (see Section 6 for command desc.)
  211.            !==============================================================
  212.            !  READ.V - Some examples of writing and reading from the
  213.            !           buffer file.
  214.            !
  215.            $Where = $port                        ! this selects the buffer
  216.            $File = "c:\vbbs\b" & $where & ".tmp" ! for the node you're on
  217.            !
  218.            !  Check to see if the file is there; if so, delete it.
  219.            CHECKFILE $Len $File
  220.            IFVAL $Len > 0 Then
  221.               KILL $File
  222.            ENDIF
  223.            !  Build an new one, add one line, then close it.
  224.            OPEN $File OUTPUT
  225.               WRITE "Your Handle : " $handle
  226.            CLOSE
  227.            !  Now open it, add data to the end of it, then close it again.
  228.            OPEN $File APPEND
  229.               WRITE "The BBSName : " $bbsname
  230.               WRITE "Your Baud Rate : " $baud
  231.               WRITE "The Sysop's Name : " $sysop "  and the time : " $time
  232.            CLOSE
  233.            !  Now re-open it, read the data back, print it, and close it.
  234.            OPEN $File INPUT
  235.            # Tag
  236.               READ $Line
  237.               TEST $Line = "!EOF!" End
  238.               TR $Line
  239.               GO Tag
  240.            # End
  241.            !  Now close and remove the file
  242.            CLOSE
  243.            KILL $File
  244.            !==============================================================
  245.  
  246.                 With very little work you could actually write an editor
  247.            using the combination of the BUFFER commands and the commands
  248.            above.  The options are limitless once you set your mind to it.
  249.  
  250.  
  251.                                             VBBS 6.11 Documentation -- 10-J-6
  252.  
  253.  
  254.            !=============================================================
  255.            !     Control Example (see Section 7 for command descriptions)
  256.            !=============================================================
  257.            !  Waiting.V - This is a small script to force the user to
  258.            !              do nothing for 30 seconds.  It is also an
  259.            !              example of how to use the various control
  260.            !              structures to accomplish the same goals.
  261.            $x = 1
  262.            $y = 0
  263.            CALL drawit                      !----------------------------
  264.            DO $a = 1 10                     !  These
  265.               CALL slowit                   !    three
  266.            LOOP                             !      lines
  267.            CALL drawit                      !----------------------------
  268.            # again                          !  And
  269.            IFVAL $x < 11 THEN               !    \
  270.               CALL slowit                   !    all
  271.               $x = $x + 1                   !      \
  272.               GO again                      !      nine
  273.            ELSE                             !        \
  274.               GO notagain                   !         of
  275.            ENDIF                            !          \
  276.            # notagain                       !           these
  277.            CALL drawit                      !----------------------------
  278.            # lastone                        !  And
  279.               CALL slowit                   !    \
  280.               $y = $y + 1                   !    these
  281.               TESTVAL $y = 10 alldone       !       \
  282.               go lastone                    !        five
  283.            # alldone                        !----------------------------
  284.               exit start                    !  do the same thing
  285.            # drawit                         !----------------------------
  286.               TR
  287.               DRAWWAITBAR 10
  288.            RET
  289.            # slowit
  290.               DELAY 1
  291.               TS "*"
  292.            RET
  293.            !=============================================================
  294.  
  295.  
  296.