
EleBBS questionnaire added commands
===================================

In addition to the Questionaire commands found in RemoteAccess, several
additional commands have been added to EleBBS, making it a much more
powerfull script language. Below is a description of the commands that
are added:


          Ascii
          
          Syntax:      Ascii <var num> <value>

          Description: Stores the character with the ASCII value into the
                       defined variable number.

          Example:     Ascii 1 178

                       This puts the character with ASCII value 178
                       into variable number 1.



          Calc
          
          Syntax:      Calc <var num> <var num> <operator> <var num>

          Description: This performs a mathmatical calculation and stores
          the result into the first variable.

          The operators supported are: <+> <-> <*> </> which are known
          as add, subtract, multiply, and divide.

          Examples:    Calc 1 2 + 3

                       This will add the value of variable number 2 with
                       the value of variable number 3 and stores the result
                       into variable number 1.

                       Calc 1 2 / 3

                       This will divide the value of variable number 2 by
                       the value of variable number 3.  If the result is
                       a non-integer value the decimal point and any
                       numbers to the right of it will be removed (to make
                       it an integer). The result is stored in variable
                       number 1.

                                                                                                                    whole number (integer), and is stored in <varnum1>.

          ConCat
          
          Syntax:      ConCat <result var num> <var num> <var num>

          Description: Concationates (combines) 2 variables, and stores
                       the results into another variable. If the total
                       length of the combination is over 255 characters
                       then it is truncated after character 255.

          Example:     Assign 2 Ele
                       Assign 3 BBS
                       Concat 1 2 3
                       Display 1

                       This will display "EleBBS"



          Cursor
          
          Syntax:      Cursor <x-pos> <y-pos>

          Description: This sets the cursor to the Horizontal and Vertical
                       positions defined. It is simular to using both the
                       SetX and SetY functions.

          Example:     Cursor 79 22

                       This places the cursor at position 79 22



          Dec
          
          Syntax:       Dec <var num>

          Description:  Decreases the variable value by one.

          Example:      Dec 1

                        Will subtract one from the value of variable 1.



          Delay
          
          Syntax:      Delay <milliseconds>

          Description: Delays the system for <milliseconds> milliseconds.
                       1000 milliseconds is one second.

          Example:     Delay 1000

                       This will delay the system for one second.



          Delimit
          
          Syntax:      Delimit <var num> <value> [<space>] or [<zero>]
                                                 [<front>] or [<back>]
                                                  [<yes>]  or  [<no>]

          Description: Shortens the length of a variable to the defined
                       number of characters, if the variable is currently
                       longer then this value.
                       This can be identical to using the function
                       "Substring <varnum> <varnum> 1 <value>"

                       You can also optionally pad a variable with spaces
                       or zeros, to force it to a fixed length. By default
                       the <back> mode is assumed, so the padding is done
                       to the left of the existing characters. You can
                       specify <front> to pad in front of the existing
                       characters instead if desired.

                       Color codes can be either counted or ignored by
                       specifying <yes> or <no> as the last parameter.


          Example:     Assign 1 EleBBS
                       Delimit 1 3
                       
                       This will shorten variable 1 from 6 to 3 characters,
                       changing it to "Ele".

          Example:     Assign 1 EleBBS
                       Delimit 1 10 space

                       This will lenghten the size of variable number 1
                       from 6 characters to 10 Characters, changing it to
                        "EleBBS    ".

          Example:     Assign 1 EleBBS
                       Delimit 1 10 space front

                       This will lenghten the size of variable number 1
                       from 6 characters to 10 Characters, changing it to
                       "    EleBBS".



          Display
          
          Syntax:      Display [<text>] [<var num>]

          Description: Unlike the Display function in RemoteAccess,
                       this will allow you to display either text, a
                       variable, or even both. Any pipe symbols "|"
                       are converted to carrage returns.

          Example:     Display "Hello|"

                       This will display the text "Hello" followed by
                       a carrage return.

          Example:     Display 1

                       This will Display the contence of variable 1.


          Example:     Display "The result is " 1
          
                       This will display both the text and the
                       contence of variable 1.


                       
          DisplayLocal
          
          Syntax:      DisplayLocal [<text>] [<var num>]

          Description: This is simular to the Display function, but it
                       will only display the text on the local side.
                       The sysop will see the text, but not the user.
                        in RemoteAccess,

          Example:     DisplayLocal "Hello|"

                       This will display the text "Hello" followed
                       by a carrage return to the sysops screen only.
                       


          DoContinue
          
          Syntax:      DoContinue <var num>

          Description: Sets <var num> to YES or NO depedending on the
                       last choice the user selected on a More(Y/n/=)?
                       language prompt.


          Example:     DoContinue 1

                       This will set variable number 1 to YES if the
                       user selected YES to the last More(Y/n/=) prompt.



          EmulateInput
          
          Syntax:       EmulateInput <string>

          Description:  Pushes one or more keys into the users input
                        buffer.  Here after, EleBBS treats them as if
                        they were actually pressed by the user. The ';'
                        character is converted to a carrage return.

          Example:      Emulateinput F

                        Places an 'F' into the users input buffer.



          EmulateSys
          
          Syntax:       EmulateSys <string>
                               
                        Simular to the Emulate input function.
                        Pushes one or more keys into the sysops input
                        buffer. Here after, EleBBS treats them as if
                        they were actually pressed by the user. The ';'
                        character is converted to a carrage return.

          Example:      EmulateSys X

                        Places an 'X' into the sysops input buffer.
                               


          EmulateVar
          
          Syntax:       EmulateVar <var num>

          Description:  Simular to the Emulate input function. Pushes one
                        or more keys (contained in the variable) into the
                        users input buffer. Here after, EleBBS treats them
                        as if they were actually pressed by the user.

          Example:      EmulateVar 1

                        Places the contence of variable number 1 into the
                        users input buffer.



          EmulateSysVar
          
          Syntax:       EmulateSysVar <var num>

          Description:  Simular to the Emulate input function. Pushes one
                        or more keys (contained in the variable) into the
                        sysops input buffer. Here after, EleBBS treats them
                        as if they were pressed by the sysop.

          Example:      EmulateVar 1

                        Places the contence of variable number 1 into the
                        sysops input buffer.



          FileExist
          
          Syntax:       FileExist <var num> <[path]filename>

          Description:  Sets <var num> to either YES or NO depending on
                        wether the specified file exists or not.

          Example:      FileExist 1 c:\bbs\busy.sem

                        Places YES in variable number 1 if the file exists.



          GetArrowKey
          
          Syntax:       GetArrowKey <var num>

          Description:  Waits for the user to press a key and returns the
                        key pressed in the defined variable. If one of the
                        arrow keys is pressed, then one of the words
                        "UP", "DOWN", "RIGHT" or "LEFT" is returned in the
                        variable according to the key pressed. The Ins and
                        Del keys will return "INSERT" and "DELETE". Any
                        alpha keys (a-z) are converted to upper case
                        automaticly. The Enter key is converted to the pipe
                        symbol "|" to make it easy to check for.

          Example:      GetArrowKey 1

                        Gets the pressed key in variable number 1.



          GetBBSOS
          
          Syntax:       GetBBSOS <var num>

          Description:  Writes the Operating System that this version of
                        EleBBS was compiled for to the defined variable.
                        Note that if you are running the DOS version of
                        EleBBS under OS/2 or Windows, it will still report
                        "DOS" as the OS version.

                        Current possibilities are "DOS", "OS/2", "WIN32",
                        "GUI", or "Linux".

          Example:      GetBBSOS 1

                        This will put the name of the OS this EleBBS is
                        designed for into variable number 1.



          GetGraph
          
          Syntax:       GetGraph <var num>

          Description:  Writes a list of all the current graphic modes to
                        the variable so that an "If In" statment can be
                        used to determine which modes are on.

          Examples:     GetGraph 1

                        If ANSI, AVATAR, and RIP are all currently
                        enabled, then variable 1 will be set to contain
                        all those keywords, "ANSIAVATARRIP" so that each
                        code can be checked for. For example:

                        GetGraph 1
                        Assign 2 ANSI
                        If 2 in #1
                          Display "ANSI is enabled"
                        EndIf



          GetParameter
          
          Syntax:       GetParameter <var num> <param num>

          Description:  This retrieves a parameter as given on the
                        command-line by EleBBS. This can be usefull
                        if you want to use one script several times.
                        This command is also used in the YESNO.Q-A
                        file which is automaticly run instead of the
                        'regular' (Y/n)? prompt.

          Example:      GetParameter 5 1

                        Assigns parameter 1 to variable number 5.



          GetRawKey
          
          Syntax:       GetRawKey <var num>

          Description:  Simular to the GetArrowKey function, but does
                        not convert the pressed key to upper case, and
                        it does not convert the Enter key to a pipe
                        symbol. It waits for a keypress from the user and
                        returns the key pressed when there was no cursor
                        key pressed. When there was a cursor key pressed,
                        EleBBS will return "UP", "DOWN", "RIGHT" or
                        "LEFT" according to the key pressed. The Ins key
                        will return "INSERT" and the Del key will return
                        "DELETE".

          Example:      GetRawKey 1

                        Gets the key pressed in variable number 1.



          GetSystemName
          
          Syntax:       GetSystemName <var num>

          Description:  Puts the Name of your BBS into <var num>.
                        This is the name you have defined in ELCONFIG
                        under SYSTEM > SITE INFO.

          Example:      GetSystemName 1

                        This puts the BBS name into variable number 1.



          GetTelnet
          
          Syntax:       GetTelnet <var num>

          Description:  Puts YES or NO into <var num> depending on the
                        type of session. This only returns YES if the
                        session is started using EleBBS's TELSRV, not with
                        other telnet servers like COM/IP or NetModem.

          Example:      GetTelnet 1

                        This puts YES into variable number 1 if the current
                        node is running EleBBS's TELSRV.



          GetVolumeLabel
          
          Syntax:       GetVolumeLabel <var num> <drive letter:>

          Description:  Writes the Volume label of the hard drive specified
                        to the variable.

          Example:      GetVolumeLabel 1 C:

                        This will put the volume label of drive C: into
                        variable number 1.



          If in [at]
          
          Syntax:       If <var num> in #<var num> [at <var num>]

          Description:  Searches for the contence of the first variable
                        within the second variable. If a match was found,
                        it can [optionally] store the resulting offset of
                        the match in the third variable.

          Examples:     If 1 in #2
           
                        Searchs variable number 2 to find if it contains
                        the text in variable number 1. If a match occurs,
                        any code below here and before the EndIf statment
                        is executed.

                        If 1 in #2 at 10
                        
                        Searchs variable number 2 to find if it contains
                        the text in variable number 1. If a match occurs
                        starting at the 5th character of variable number
                        2, then variable number 10 is set to 5, and any
                        code below here and before the EndIf statment is
                        excuted.
                       


          Inc
          
          Syntax:       Inc <var num>

          Description:  Increases the variable value by one.

          Example:      Inc 1

                        Will add 1 to the value of variable number 1.



          IncludeQA
          
          Syntax:      IncludeQA [path]<filename>

          Description: This includes another Q-A file, which is read into
                       into memory and executed as if it was part of the
                       current Q-A file. The included file does have some
                       limitations, as it may not contain any subroutines
                       that are called by the main routine. Up to 10
                       IncludeQA's can be nested, so that one Q-A includes
                       another, which in turn includes another. All the
                       Included Q-A's and the master Q-A can share the same
                       variables.

                       If a path is not specified, then the file is loaded
                       from the current language files Q-A directory. If
                       no such directory is defined then it is loaded from
                       the system directory instead.

          Example:     IncludeQA DATAFILE.Q-A

                       This reads the DATAFILE.Q-A into memory, and executes
                       it. Control is then returned to the first Q-A.


                       
          KeyPress
          
          Syntax:       KeyPress 1

          Description:  Checks the keyboard buffer to see if any keys have
                        been pressed, and sets the result (YES or NO) in
                        the defined variable number.

                        If the result is YES, then the key is still in the
                        buffer, so it can be then read by using either a
                        GetArrowKey or GetRawKey command afterwards.

          Example:      KeyPress 1

                        Puts either YES or NO into variable number 1.



          Length
          
          Syntax:      Length <var num> <var num>

          Description: Stores the length of the second variable into the
                       first variable.

          Example:     Assign 2 EleBBS
                       Length 1 2
                       Display 1

                       This will display "6".



          LowerCase
          
          Syntax:      LowerCase <var num>

          Decription:  Converts any upper case letters in the defined
                       variable number to lower case.

          Example:     LowerCaseCase 1



          Ord
          
          Syntax:      Ord <var num> <var num>

          Decription:  Puts the ascii numeric value of the first character
                       of the second variable into the first variable.

          Example:     Assign 2 dog
                       Ord 1 2

                       This will store the ascii value of the letter 'd'
                       in variable number 1.



          PageMode
          
          Syntax:      PageMode <var num> <var num>

          Description: Sets the variables with the current paging modes.
                       The first variable is set to ON or OFF depending on
                       wether the user is allowed to page the SysOp.
                       The second variable is set to ON or OFF depending on
                       wether the scrol-lock is on. When the scroll-lock is
                       enabled, EleBBS will not make any paging sounds.

          Example:     PageMode 1 2

                       Sets variables numbers 1 and 2 to ON or OFF.



          PopColor
          
          Syntax:       PopColor <slot number>

          Description:  Retrieves the saved text attribute. You can
                        retrieve one of the 20 previous saved text
                        attributes.

          Example:      PopColor 1

                        Retrieves the saved text color from Cslot 1.



          PopX
          
          Syntax:       PopX <slot number>

          Description:  Retrieves the saved horizontal position of the
                        cursor. You can retrieve one of the 20 previous
                        saved cursor positions.

          Example:      PopX 1

                        Retrieves the saved horizontal cursor position
                        from Xslot 1.



          PopY
          
          Syntax:       PopY <slot number>

          Description:  Retrieves the saved vertical position of the
                        cursor. You can retrieve one of the 20 previous
                        saved cursor positions.

          Example:      PopY 1

                        Retrieves the saved vertical cursor position
                        from Yslot 1.



          PushColor
          
          Syntax:       PushColor <slot number>

          Description:  Saves the current color attribute which
                        EleBBS will use to display text to a
                        buffer. You can define up to 20 'slots'
                        to save it in.

          Example:      PushColor 1

                        Saves the current attribute in Cslot 1.



          PushX
          
          Syntax:       PushX <slot number>

          Description:  Saves the current horizontal position of the
                        cursor to a buffer. You can define up to 20
                        'slots' to save it in.

          Example:      PushX 1

                        Saves the current horizontal cursor position
                        in Xslot 1.


                        
          PushY
          
          Syntax:       PushY <slot number>

          Description:  Saves the current vertical position of the
                        cursor to a buffer. You can define up to 20
                        'slots' to save it in.

          Example:      PushY 1

                        Saves the current vertical cursor position
                        in Yslot 1.



          Random
          
          Syntax:       Random <max value> <var num>

          Description:  Stores a random number into the defined variable
                        number, between zero and one less the defined
                        value.

          Example:      Random 10 1

                        Stores a value between 0 and 9 into variable
                        number 1.



          SetOLM
          
          Syntax:       SetOLM <on or off>

          Description:  Turns the multinode OLM (On-Line Messages) on
                        or off. This is usefull if you do not want the
                        on-line messages to interupt the current script.
                        Setting them to off will prevent EleBBS from
                        checking for them while the script is running.

          Example:      SetOLM OFF

                        This prevents EleBBS from checking for on-line
                        messages while the script is running.



          SetResult
          
          Syntax:       SetResult <text>

          Description:  Returns a value to EleBBS. This is only usefull
                        for questionnaire files that are supported by
                        EleBBS internally.

          Example:      SetResult YES

                        Returns YES to EleBBS.



          SetChatReason
          
          Syntax:       SetChatReason <var num>

          Description:  Sets the reason why the user wants to chat to
                        the text defined in the variable number.
                        This function is usefull for custom pager
                        scripts.

          Example:      SetChatReason 1



          SetChatWanted
          
          Syntax:       SetChatWanted <on or off>

          Description:  Displays the flashing "Wants Chat" when the status
                        bar is set to mode 5, indicating that the user has
                        requested to chat with the sysop.

          Example:      SetChatWanted ON



          SetResultVar
          
          Syntax:       SetResultVar <var num>

          Description:  Simular to the SetResult function. Returns a value
                        to EleBBS. This is only usefull for questionnaire
                        files that are supported by EleBBS internally.

          Example:      SetResultVar 1

                        Returns the value of variable number 1 to EleBBS.



          SetStatusBar
          
          Syntax:       SetStatusBar <value>

          Description:  Sets the status bar (at the bottom of the screen)
                        to the desired mode from 1-10. These are the same
                        modes that can be set by the sysop by pressing
                        the F1 through F10 keys on the sysops keyboard.

                        The following StatusBar modes are available:

                        1 - Name, City, Baud, Security, Time Left, Node,
                             Paging Mode, Graphic mode, WantsChat flag.
                        2 - Phone Numbers, First/Last/Total calls, Age, DOB.
                        3 - Uploads, Downloads, Taged files, Flag Setings.
                        4 - Last Caller, Total BBS calls, Time, Next Event.
                        5 - Msgs Posted, Language, Group, Credit, Handle.
                        6 - Comment, Reason for chat.
                        7 - EMSI information.
                        8 - Nothing.
                        9 - Alt-Key Help menu.
                       10 - Remove status bar.

          Example:      SetStatusBar 6

                        This will set the StatusBar to Mode 6.



          SetTime
          
          Syntax:      SetTime <value or #var num>

          Description: Sets the users time left today to the number of
                       minutes specified. 

          Example:     SetTime 100

                       Sets the users time left today to 100 minutes.

          Example:     SetTime #1

                       Sets the users time left today to the value in
                       variable number 1.


                       
          SetUserOn
          
          Syntax:       SetUserOn <text>

          Description:  Writes up to 10 characters to the USERON.BBS
                        describing to other nodes what the user is
                        currently doing.
          
          Example:      SetUserOn Browsing

                        Writes the text "Browsing" to that nodes
                        useron setting.



          SetUserVar
          
          Syntax:       SetUserVar <char> <text or #varnum>

          Description:  Sets any of the Users internal records that
                        are displayable using a ^F macro.

                        This is a very powerfull command, as it allows
                        changing any of the information in the users
                        record, such as the number of uploads, downloads,
                        their organization, their address, or dozens of
                        other records.

                        The charcter that is passed is the same character
                        used in the corrosponding Ctrl-F macro.

          Example:      SetUserVar [ Visiting Sysop
     
                        Since "Ctrl-F[" is the macro to display the users
                        comment, using "[" as the character with this
                        function will write the defined text to the
                        users comment field.
                       
          Example:      SetUserVar ~ #1

                        Since "Ctrl-F~" is the macro to display the users
                        organization field, using "~" as the character
                        with this function will write the text stored in
                        variable number 1 to the users organization field.



          SetX
          
          Syntax:       SetX <value>

          Description:  Sets the horizontal cursor position to the desired
                        location.

          Example:      SetX 80

                        Moves the cursor to the right edge of the screen.



          SetY
          
          Syntax:       SetY <value>

          Description:  Sets the vertical cursor position to the desired
                        location.

          Example:      SetY 24

                        Moves the cursor to the bottom line of the screen.



          SubString
          
          Syntax:       SubString <var num> <var num> <value> <value>

          Description:  Copys part of the second variable into the first
                        variable, starting at the offset of the first
                        value, up to the number of characters in the
                        second value.

          Example:      Assign 2 supercalifragilisticxpalidocus
                        SubString 1 2 10 5
                        Display 1

                        This would display "fragi"
                        because variable number 1 now contains 5 characters
                        from variable 2, starting at character number 10.



          SubStringVar
          

          Syntax:      SubStringVar <var num> <var num> <var num> <var num>

          Description:  Simular to the SubString function, but uses four
                        variables.

                        Copys part of the second variable into the third                       first variable, starting at the offset found in the
                        third variable, up to the number of characters in
                        the fourth variable.

          Example:      Assign 2 supercalifragilisticxpalidocus
                        Assign 3 10
                        Assign 4 5
                        SubStringVar 1 2 3 4
                        Display 1

                        This would display "fragi"
                        because variable number 1 now contains 5 characters
                        from variable 2, starting at character number 10.



          UpperCase
          
          Syntax:      UpperCase <var num>

          Decription:  Converts any lower case letters in the defined
                       variable number to upper case.

          Example:     UpperCase 1



          WasSysopKey
          
          Syntax:      WasSysopKey <var num>

          Description: Determines if the last key pressed was pressed
                       by the user or the sysop. If it was the sysops
                       key then <var num> will be "YES". If it was the
                       users key then <var num> will be "NO".

           Example:    WasSysopKey 1

                       If the sysop pressed the last key, then variable
                       number 1 will be set to "YES".



          While do
          
          Syntax:       While <var num[~]> <operator> <operand> do

          Description:  Creates a conditional loop without requiring a
                        goto label. The syntax is the same as the "If"
                        statment. It is used to perform comparisons
                        within your script, and perform actions based
                        on the results of the comparisons.  The result
                        of the comparison is considered to be either
                        true or false.  If the comparison is found to
                        be true, then all lines up to the next EndWhile
                        will be performed. <var num> may be any variable
                        number, which can be followed by an optional "~"
                        tilda character to indicate that the comparison
                        should be numeric rather then a text comparison.

                        The <operator> can be any combination of:
                            =       Equal to
                            <       Less than
                            >       Greater than

                        The <Operand> can be:

                            A variable number specified as #<var num>
                            Literal text enclosed in quotation marks.
                            A ^K or ^F control code.

          Example:      While 1~ <= #2 do
                          Display "|Counting ..." 1
                          Inc 1
                        EndWhile




EleBBS also supports all the RemoteAccess Q-A commands listed in RA.DOC

