|
|
- Script
- Script Files
- Basic Syntax
- Simple Variables
- Global Array Variables
- a) Functionals
- b) System
- c) Colors
- d) User Record
- e) Database Access
- f) Caller ID
- String Literals
- String Expressions & String Parameters
- Numeric Expressions
- Command Reference
- - Data Output Commands
- - Program Control Commands
- - Data Input Commands
- - String Commands
- - General File I/O Commands
- - Miscellaneous Commands
- - Database Manipulation Commands
- - Email-Related Commands (Usually Used in FBs)
- - File-Related Commands (Usually Used in FBs)
- - Message-Related Commands (Usually Used in FBs)
- - Database Selection Commands (Used in MESSAGE.FB/FILE.FB)
- How to Launch a Script
- Tips
|
This document explains how to create script files and
describes the available set of script commands and functions
available when programming script for your system. Throughout
this document, script code fragments (examples) are preceeded
by the characters ">>".
|
Scripts are one of the many ways in which you can modify
or customize the look, feel, and functionality of your BBS.
Script files are simple ASCII text files. They must have a
.V filename extension, and they reside in the Script Directory,
usually C:\VADV\V, although this will differ if you installed
to a different drive and/or directory. Script files do NOT require
compilation.
It is recommended that you use a plain text editor to create
and modify scripts, such as MS-DOS EDIT or similar. If you wish
to use something fancier, such as Word for Windows, make sure
you save your script file in Text Format. (Other word processors
may refer to this as ASCII or Plain Text format.)
It is also recommended that you not attempt to edit a script
which is in-use (being executed). If needed, copy the script to
another directory and work on it there.
|
A script file is basically just lines of text. A line may
be blank, or contain a comment, a label, or a command with
accompanying keywords and/or arguments. Here is an example
showing a blank line:
>> cls
>>
>> ? "Hello World!"
The "'" character at the start of a line denotes a comment.
Here is an example showing a comment:
>> cls
>> 'Now This is a comment
>> ? "Hello World!"
The ":" character denotes a label. Note the placement of
the ":" at the END of the label. Here is an example showing
a label:
>> cls
>> gosub printmsg
>> exit
>>
>> printmsg:
>> ? "Hello World!"
>> return
Notice that the ":" is left off when the label is actually
used in a GOTO or GOSUB command.
|
260 simple variables are available for use by your script.
Variables names are limited up to two characters; the first character
must be a character from "A" to "Z", and the second character must
be a digit from "0" to "9". (That means you have variables
A0 to A9, B0 to B9, and so on up to Z0 to Z9.)
Note that if you use a single-character variable name, as in:
>> let a = 10
Thats the same as writing:
>> let a0 = 10
|
You have one global array to use. It has slots 0 to 255.
You indicate that you want to access the global array by using
the "$" character. You may access a slot by using a number or
a variable. This is an example using a number:
>> print $12
It prints out the contents of whatever was in slot 12. This
is an example using a simple variable:
>> let y1 = 10
>> print $y1
This is an example showing how to clear out the global array
using a DO-LOOP structure:
>> do i,1,100
>> let $i = ""
>> loop
|
The "!" character indicates access to the special values,
and works similarly to the global array variable. Here are two
examples that both do the exact same thing:
>> print !12
>> let z = 12
>> print !z
!12 happens to be the current channel number.
The special values are divided into six groups based on their
function. Those groups are a) Functionals, b) System, c) Color,
d) User Record, e) Database, and f) Caller ID.
a) Functionals
--------------
Functionals take values from the simple vairables x, y, and
z, as shown below. You must use the LET command to set the x
(and sometimes y and z) variable(s) before trying to use the
function. While the example show here primary use the PRINT
command to illustrate usage, it is important note that you
can freely use functions in string and numeric expressions.
0 chr(x) - Character Function
>> let x=65
>> print !0
The above example would print the character "A", since "A"
is the character represented by the ASCII code 65. Valid
values for x the standard ASCII codes, 0 to 255.
1 asc(x) - ASCII Code Function
>> let x="A"
>> print !1
The above example would print the number 65, since 65
is the ASCII code for the character "A".
2 sqr(x) - Square Root Function
>> let x=4
>> print !2
The above example would print the result 2, since 2 is the square
root of 4.
3 int(x) - Integer Function
>> let x=5.5
>> print !3
The above example would print the result 5, chopping off
the fractional part of the number.
4 abs(x) - Absolute Value Function
>> let x=-4
>> print !4
The above example would print the result 4.
5 ucase(x) - Upper Case Function
>> let x="Hello World!"
>> print !5
The above example would print the string "HELLO WORLD!".
6 rnd(x)
>> let x=1
>> print !6
The above example would print a random floating-point number
from 0 to 1. To generate a random number between 1 and some
given limit, for example 100, use some arithmetic:
>> let x=1
>> let x=!6*100 <------ get random number, multiply by
>> let x=!3+1 <-- 100, and store result back in x.
|
----- use int(x) function to truncate any
remaining fractional part and add 1.
7 len(x) - String Length Function
>> let x="Hello World!"
>> print !7
The above example would print the result 12.
8 instr(x,y) - InString Function
>> let x="ABCD"
>> let y="C"
>> print !8
The above example would print the result 3, since the substring
"C" is in the third position of the mainstring "ABCD". If the
substring cannot be found the result is zero.
9 left(x,y) - Left String Function
>> let x="ROLAND DE GRAAF"
>> let y=6
>> print !9
The preceeding example would print the string "ROLAND".
10 mid(x,y,z) - Mid String Function
>> let x="ABC"
>> let y=2 <---- set position
>> let z=1 <---- set number of characters to retrieve
>> print !10
The above example would print the string "B".
11 right(x,y) - Right String Function
>> let x="ROLAND DE GRAAF"
>> let y=8
>> print !11
The preceeding example would print the string "DE GRAAF".
27 lower(x) - Lower Case Function
>> let x="Hello World!"
>> print !27
The above example would print the string "hello world!".
b) System
---------
12 Channel Number
13 Carriage Return
14 Date
15 Date/Human Format
16 Time
17 Highest NetworkID #
18 NetName(x)
19 BBS Name
20 SysOp Name
21 YN<cr>
22 Global Result Code
23 Current Video Mode, Working Stroage Value (see also #53)
24 Baud Rate (0=Local console)
25 Text Directory Path
26 Data Directory Path
28 COM Port #
29 SysOp Available (0=No, 1=Yes)
c) Colors
---------
30 Normal Color
31 Red
32 Green
33 Yellow
34 Blue
35 Magenta
36 Cyan
37 White
38 Bold
39 Base Color
40 Prompt Color
41 Input Color
42 Reserved
43 Reserved
44 Reserved
45 Reserved
46 Reserved
47 Reserved
48 Reserved
49 Reserved
The following two examples both accomplish the same effect:
>> print !31, "Red", !32, "Green"
>> print !31 % "Red" % !32 % "Green"
Note that "%" is the string concatenation operator.
d) User Record
--------------
The user record variables let you have access to the user's
account data. The ones marked with an asterisk "*" are also
writable.
50 User Number
51* User Handle
52* User Name
53* User Video Mode, Long-Term Storage Value (see #23)
54* User Security Level
55* User Time Limit
56* User Access Flags
57* User Flags
58* User Credits
59* User Expiration Date
60* User Page Size
61* User Extra #1
62* User Extra #2
63* User Extra #3
64* User Extra #4
65* User Extra #5
66* User Extra #6
67* User Extra #7
68* User Extra #8
69 User Total Number of Calls
70 User Total Mins Online
71 User Time On (Current Login)
72 User Time Left (Current Login)
73 User Date Last On (YYMMDD Format)
74* User # of Files Downloaded
75* User # of Kilobytes Downloaded
76* User # of Files Uploaded
77* User # of Kilobytes Uploaded
78* User # of Emails
79* User # of Posts
80* User Address
81* User City
82* User State
83* User Zip Code
84* User Phone #1
85* User Phone #2
86 User Age
87* User Birthdate - Month
88* User Birthdate - Day
89* User Birthdate - Year
This is an example showing how to set the security level:
>> let !54 = 100
This is an example showing how to increase a user's credits by 500:
>> let !58 = !58 + 500
e) Database Access
------------------
The first 3 values, 90 through 92 are set by your use
of the script DBGROUP command, which selects a topic group:
90 Current Topic Group Letter
91 Current Topic Group Description
92 Number of Databases in Group
The values 93 through 99 are set by your use of the script
DB command, which selects a database within the current
topic group:
93 Current Database Number
94 Current Database Description
95 Number of Entries in Database
96 Next-New-Message Read Pointer
97 Database Filename (no extension)
98 Database Attached-File Storage Path
99 Database Maximum
The values 100 through 117 are set by your use of the script
LOAD command, which loads data one entry from the currently
selected database:
100 Subject
101 From field, Handle or Name
102 From field, User number (0=Not Applicable)
103 From field, Network Address
104 From field, NetworkID
105 To field, Handle or Name
106 To field, User number (0=Not Applicable)
107 To field, Network Address
108 To field, NetworkID
109 Date/Time Stamp (String)
110 Count
111 Attached Filename (If Any)
112 Attached File Size (0=None)
113 Attached File/Full Path Format (If Any)
114 Offset into BIN file of text component
115 Length of BIN file text component
116 Date/Time Stamp (Numeric)
117 Flag field
f) Caller ID
------------
140 CID Name
141 CID Phone Number
NOTE: For most modems, the command to turn on Caller ID is AT#CID=1
and you must set the BBS to answer on at least 2 rings, since
CID info is sent by the telco between ring 1 and ring 2.
|
A string literal is just a sequence of characters, enclosed
in double quotes, such as "string literal". Here are some examples
using string literals:
>> print "Hello World!"
>> let x="ABCD"
>> exit "main"
>> if a="Y" goto yes
|
A STRING PARAMETER is a literal string ("hello"), a
variable possibly containing string data (x1), or a special
value (!51, for example).
When working with any of the script commands that
take parameters, you may use any of the three types of
STRING PARAMETER types listed in the previous paragraph.
The following example shows how a STRING EXPRESSION
is used in the LET statement, but that a STRING PARAMETER
is used in the LOG statement:
>> let z = "User #" % !50 % " completed the questionnaire"
>> log z
A STRING EXPRESSION is when you use the "%" character
as the "string append" operator, to combine strings together.
STRING EXPRESSIONS can only be used in LET statements.
The following example shows how a STRING EXPRESSION
is used in the LET statement, but that a STRING PARAMETER
is used in the PRINT statement:
>> let a = "Your Name is " % !51
>> print a
In addition to the % operator, the relational operators
<, >, <=, >=, =, and <> can be used to test for string order.
|
The following mathematical, bitwise, and relational operators
are available for use in numeric expressions:
^ Exponentiation
+ Addition
- Subtraction
* Multiplication
/ Floating-Point Division
\ Integer Division
# Modulo Arithemtic
| Bitwise OR
& Bitwise AND
> Greater Than
>= Greater Than Or Equal
< Less Than
<= Less Than or Equal
= Equal
<> Not Equal
Numeric expressions maybe used anywhere. In LET statements,
and as parameters in the other script commands.
|
As you read the COMMAND REFERENCE, bear in mind that
the following commands may be used in a SCRIPT or as an
internal command in a FUNCTION BLOCK. Commands marked with
an "!" only make sense within the context of a script, and
therefore, should only be used in scripts. All other commands
can be used either from a script or from a function block.
|
**** ! CLS
Clears the screen. This command takes no parameters.
If the user is non-ansi, this entails having the BBS
send an ascii code 12, which is the TTY clear screen
command. If the user is ANSI, then the sequence
<Esc>[2J is used instead.
>> CLS
**** ! PRINT <param1>, <param2>, ..., <param31> [;]
Display text, variable data, or expression results.
From zero to 32 parameters may be given.
An optional semi-colon on the end of the line inhibits the
automatic sending of a CRLF (carraige return-linefeed) sequence.
Also abbreviated as ?.
The following example simply prints a blank line:
>> PRINT
The following prints some text, and some data from a variable:
>> let a = "Your Name"
>> PRINT "Hello ", a
This one prints 1 to 10 on a single line:
>> do i,1,10
>> ? i; " ";
>> loop
>> ?
**** ! EF <path and file spec>
Display a file on the screen, and to the remote caller.
The file could be a text file, an ANSI file, or whatever
is generally viewable.
**** ! MENU <menu filename>
Displays a menu file, in a similar manner to the way
menus files are displayed for FUNCTION BLOCKS. The
<menu filename> is an extension-less filename of 8
characters or less, and the system will by default
look for this file in your TEXT DIRECTORY, and supply
an extension of either ASC, ANS, MNU, RIP, or VWC,
depending on file availability and user video mode selection:
User Video Mode: Progression:
0 (plain text) .MNU -> .ASC
.MNU files are looked for first, and if found
are displayed with the heart code color suppressed.
If no .MNU file exists, then the system tries .ASC.
1 (ANSI) .MNU -> .ANS
2 (Enh ANSI)
.MNU files are looked for first, and if found
are displayed with the heart code color. If no .MNU
file exists, then the system tries .ANS.
3 (RIP) .RIP -> .MNU -> .ANS
.RIP files are looked for first, and if found
are displayed verbatim. If not found then
.MNU files are looked for second, and if found
are displayed with the heart code color. If no .MNU
file exists, then the system tries .ANS.
4 (VWC) .VWC -> .MNU -> .ANS
.VWC files are looked for first, and if found
are displayed verbatim. If not found then
.MNU files are looked for second, and if found
are displayed with the heart code color. If no .MNU
file exists, then the system tries .ANS.
**** ! ANSIC <numeric expression>
Transmits Ctrl-C (heart code) color. Allowable values
are 0 to 35 for <numeric expression>.
>> ansic 0
>> ansic a
**** ! LOC <row>, <column>
Position the text screen cursor at the position given.
<row> and <column> are numeric expressions.
**** ! SUSPENDPAGEBREAK
Turn off page-break checking.
**** ! RESUMEPAGEBREAK
Turn page-break checking back on again.
**** ! NEWPAGE
Resets the internal page-break line coutner to 0.
**** ! PAUSE <prompt string>
Displays the pause prompt string, and waits for the caller
to press any key. If the string parameter <prompt string>
is omitted, the default system prompt (external string #19)
is used instead.
|
**** ! GOTO <line label>
Go to the line label specified, and continue execution
from there.
>> GOTO nextentry
**** ! GOSUB <line label>
Execute a subroutine. Program control passes to the
line label specified. A matching RETURN statement
in the subroutine returns control to the calling routine.
>> GOSUB docalculation
**** ! RETURN
Return control back to the calling routine, which executed
the GOSUB.
>> RETURN
**** ! DO <var>, <start>, <end> [, <increment>]
Form the beginning of a DO-LOOP structure. <var> must be
a variable; <start>, <end>, and <increment> must be numeric
expressions of some sort. Note that the <increment> field
is optional, and if omitted, defaults to 1.
>> DO c,1,100
>> ? c
>> LOOP
**** ! LOOP
Form the end of a DO-LOOP structure. This command takes no
parameters. Note that DO-LOOP structures may be nested up to
10 levels deep.
**** ! IF <string relational expression> GOTO <label>
This command can be used to compare two string paramaters
to each other, and make a decision based on the result.
If the relationship is true, then the <label> specified
is found and program execution resumes there. If the
relationship is false, then execution continues normally
on the next line.
**** ! IFVAL <numeric expression> GOTO <label>
This command is exactly like the IF command, except it
is more suited to working with numeric values. If the
<numeric expression> evaluates to ZERO (false), then
execution continues normally on the next line. If the
<numeric expression> evaluates to NON-ZERO (true), then
the <label> is found and execution continues there.
**** LOGOFF
-or-
LOGOFFYN
Proceed to the log-off sequence -- LOGOFFYN gives the
caller a chance to change their mind, LOGOFF does not.
**** ! EXIT <function block>
-or-
END <function block>
End the current script, and transfer control to a function
block. <function block> is a string parameter, and should
specify an eight-character or less extension-less function
block filename. If <function block> is omitted, the most
recent function block is referenced. (This reference
is cleared by execution of the LINK command, so therefore
it is recommended that you use the full form everytime.)
NOTE: DO NOT use EXIT or END in cases where the script
is being CALLed from another script, unless ending
script execution altogether is your desired effect.
**** ! LINK <script name>
End the current script, and transfer control to another script.
<script name> is a string parameter, and should an eight
character or less filename, without an extension.
**** ! CALL <script name>
Saves the execution position of the current script, and loads
and executes another script. When the CALLed script runs out
of lines to execute, control returns to the old script at the
position where the interpreter left off.
NOTE: Script invoked by external string (ie. DEFAULT.S) are
always automatically executed as though they were CALLed,
so as not to disturb any script which may be running at the time.
CALLs may be nested up to 20 levels deep, and recursion
is allowed -- BUT BE VERY CAREFUL WITH THIS COMMAND IF YOU
ATTEMPT THIS.
NOTE: The "CALL stack" is LOST if VA for DOS must "shrink out"
to run a door, or if the script DOOR command is used.
**** ! SHELL <DOS or OS2 command line>
Executes, by way of the resident operating system,
the DOS or OS2 command line given, as a string
parameter.
>> shell "dir /p"
>> let f = "ADVAUX " % !12 % " TELECON"
>> shell f
**** ! DOOR <DOS or OS2 command line>
Execute a door program, batch file or other application.
<DOS or OS2 command line> is a string parameter.
DOOR differs from shell in that:
1) Dropfiles (CHAIN.TXT, DOOR.SYS, DORINFO1.DEF) Created
2) Virtual Advanced for DOS "shrinks out" of memory
to open up maximum space for the application
3) If the <DOS or OS2 command line> is omitted or null,
then the built-in door selection menu is presented.
The DOOR command is usually preceeded by either a RETURNSCRIPT
or RETURNFB block command. Since the DOS version of Virtual
Advanced "shrinks out," continuation of the script past
the DOOR command is not possible. But execution of the
script under Virtual Advanced for OS2 does continue.
So, how to handle the difference?
When your desired destination is an FB:
>> returnfb "myfb"
>> door "doorgame.bat %1"
>> exit "myfb"
When your desired destination is a script:
>> returnscript "myscript"
>> door "doorgame.bat %1"
>> link "myscript"
In either of the above situations, whether DOS or OS2,
the result is the same.
**** ! RETURNFB <function block name>
-or-
RETURNSCRIPT <script>
RETURNFB/RETURNSCRIPT control how the DOOR command behaves.
They allow your script to specify the action to be taken
after the DOOR command returns. In the case of RETURNFB,
it allows you to specify a function block as the destination
after the door call is complete. In the case of RETURNSCRIPT,
it allows you to specify a script as the destination after
a door call completes. (Often, RETURNSCRIPT is used to
return control to the script that called it.)
|
**** ! INPUT [<prompt1>, <prompt2>, ..., <prompt30>,] <var>
-or-
LINEINPUT [<prompt1>, <prompt2>, ..., <prompt30>,] <var>
Input data from a user into variables. Up to 30
optional parameters may be specified to form the
optional prompt for the input. Note that the user
must hit ENTER for the input to be accepted by the
program.
**** ! RH <var>
Scan the input queue for keystrokes (local or remote),
and return the next keystroke in <var>, if one is available.
If no data is available, <var> comes back as empty ("").
Does not wait for ENTER. Does not wait for input to
become available.
**** ! RW <var>, <prompt>
Display optional <prompt>, and input data from the user.
Data format is 80 cols per line, with automatic WORD-WRAP.
**** ! RS <var>, <prompt>
Display optional <prompt>, and input data from the user.
Data format is 80 cols per line, max.
**** ! RF <var>, <prompt>
Display optional <prompt>, and input data from the user.
Data format is limited to conventional 8.3 filename
syntax, and wildcards are not allowed.
**** ! RI <var>, <prompt>
Display optional <prompt>, and input data from the user.
Data format is limited to conventional 8.3 filename
syntax, and wildcards are allowed.
**** ! RN <var>, <prompt>
Display optional <prompt>, and input data from the user.
Data format is limited to numeric digits, and a maximum value
of 999999999.
**** ! RX <var>, <prompt>
Display optional <prompt>, and input data from the user.
Data format is limited to 8 characters maximum, and "X"
characters are echoed back to the caller instead of
the actual character typed. This is useful for passwords.
**** ! RC <var>, <prompt>
Display optional <prompt>, and wait for one keystroke
to be returned in <var>. This differs from RH in that
RH does not wait for a keystroke and will return empty
if necessary.
**** ! RR <var>, <allowed keys>, <prompt>
Display optional <prompt>, and wait for one keystroke
to be returned in <var>. Keystrokes are limited to
the ones allowed in <allowed keys>.
**** ! RL <var>, <allowed keys>, <max numeric>, <prompt>
Display optional <prompt>, and wait for user input to
be returned in <var>. Allowed input are the single
characters as specified by <allowed keys>, and the numbers
1 to <max numeric>. This is a multi-purpose input command.
You might use RL when allowing a user to access a list of
choices, say for example, text files to look at:
>> displist:
>> cls
>> do i,1,10
>> ? i,". Text File #",i
>> loop
>> ?
>> rl k1, "?Q", 10, "Your Choice: "
>> if k1="?" goto displist
>> if k1="Q" goto quit
>> let f="c:\text\text" % k1 % ".TXT"
>> ef f
>> pause
>> goto displist
>> quit:
>> exit
**** ! GETYN <var>, <prompt>
Display optional <prompt>, and wait for one character
(keystroke) from the user. Input characters allowed is limited
to Y, N, and ENTER. In the case of GETYN, pressing ENTER
defaults to Y.
**** ! GETNY <var>, <prompt>
Display optional <prompt>, and wait for one character
(keystroke) from the user. Input characters allowed is limited
to Y, N, and ENTER. In the case of GETNY, pressing ENTER
defaults to N.
|
**** ! JR <var>, <width>
Justify the text or numeric contents of a variable <var>
to the RIGHT, using the <width> specified.
**** ! JL <var>, <width>
Justify the text or numeric contents of a variable <var>
to the LEFT, using the <width> specified.
**** ! JC <var>, <width>
Justify the text or numeric contents of a variable <var>
to the CENTER, using the <width> specified.
**** ! LEFT <var>, <string parameter>, <number of chars>
Take the leftmost <number of chars> from <string parameter>
and put them into <var>. This is an alternative to the !9
function.
**** ! MID <var>, <string parameter>, <position>
-or-
MID <var>, <string parameter>, <position>, <number of chars>
Take <number of chars> from <string parameter>, starting
at <position>, and put them into <var>. If <number of chars>
is omitted, then the rest of the string is taken. This is an
alternative to the !10 function.
**** ! RIGHT <var>, <string parameter>, <number of chars>
Take the rightmost <number of chars> from <string parameter>
and put them into <var>. This is an alternative to the
!11 function.
|
**** ! FINDFIRST <path and file spec>, <var>
Start a directory search for a particular path and file
specification - may contain wildcards. Results returned
in <var>. <var> returns empty ("") when there are no
files matching the the filemask.
**** ! FINDNEXT <var>
Find next filename in a directory search. This command must
be used in conjunction with the FINDFIRST command.
**** ! XFERTIME <var>, <filesize>
Calculates the estimated download transfer time and
returns this value in <var>, given the <filesize>.
The time value returned is expressed in minutes.
**** ! CHECKFILE <var>, <path and file spec>
Performs a file check for a particular path and file
specification - may NOT contain wildcards. Results returned
in <var>:
<var> = -1 Path given does not exist
<var> = 0 Path is OK, but file does not exist
<var> > 0 Path and File are OK, and <var> indicates
file size
**** ! DOWNLOAD <path and file spec>
This command is useful for sending a file to the caller.
The user is prompted to choose a transfer protocol, and the
file specified is sent. <path and file spec> is a string
parameter.
**** ! UPLOAD <path and file spec>
This command is useful for receiving a file from a caller.
The user is prompted to choose a transfer protocol, and the
file specified is received. If a path is specified with the
filename, then the file is received into that directory.
<path and file spec> is a string parameter.
**** ! KILL <path and file spec>
Delete a file. <path and file spec> is a string
parameter, and wildcards are not allowed.
**** ! OPEN <path and filename>, <file mode>
Open up an ASCII file for manipulation with the READ and
WRITE script commands. Both parameters are string
parameters, with <file mode> being either "A"
for append, "O" for output, and "I" for input.
If a file is already open with the OPEN command when
your script tries to execute this command, the message
"File already OPEN." will appear in your BBS.LOG, and
the operation will fail.
If you try to open a non-existant file for input,
the message "File or Path OPEN/INPUT does not exist."
will appear in your BBS.LOG.
**** ! CLOSE
Close the file currently opened with the OPEN command.
This command takes no parameters.
**** ! WRITE <data to be written>
Writes data (string parameter) to the currently OPEN
file. File must be open for either input or append
modes.
If the file is not open when this command is encountered,
the message "File not OPEN." will appear in BBS.LOG. If
the file is OPEN, but for the wrong file mode, then the
message "Bad File Mode." will appear in the system log.
**** ! READ <var>
Reads the next line of data in the currently OPEN file
to a variable, <var>. If there is no more data available,
then the string "!EOF!" is returned in <var>.
If the file is not open when this command is encountered,
the message "File not OPEN." will appear in BBS.LOG. If
the file is OPEN, but for the wrong file mode, then the
message "Bad File Mode." will appear in the system log.
|
**** ! CLEAR
Clears all variables, and all slots in the global array.
**** ! RANDOM
Displays a random message from the configuration file
RANDOM.CFG. RANDOM.CFG is modifiable through VCONFIG.
**** ! LOG <string parameter>
Writes the string parameter to the log:
>> log "Hello There"
>> let x = "User Number " % !50
>> log x
**** ! ACTION <description>
Modifies what is seen by the WHO command in terms of
the action that the user is doing. <description>
is a string parameter.
**** ! DELAY <seconds>
Delay for certain time period. <seconds> is a numeric
expression.
**** ! BEEP
Causes a BEEP to be sounded locally on the SysOp's computer.
**** PAGESYSOP
This pages the sysop for chat, if the sysop is available.
**** ! ADDTIME <minutes to add>
Temporarily grant additional time to a user during this
call. <minutes to add> is a numeric expression.
**** ! SETFLAGS <flag>, <on/off>
Manipulate the 26 user flags (*not* the database access
flags, which are a separate set of flags). <flag> is string
parameter from "A" to "Z" and <on/off> is a string parameter
of either "ON" or "OFF". These flags go largely unused by
the system and are therefore available for custom uses.
The flags in use by the system are:
F - Full Screen Editor
X - Expert Mode (Menus Skipped)
N - User Has Been Sent New-User Email
I - Enable Internet Pass-Thru Access
U - Enable UUCP Access
**** STACK <keystrokes to fake>
Stack fakes keysrokes to the Virtual Advanced program.
<keystrokes to fake> is a string parameter.
**** SYSINFO
Displays the system current stats information screen.
**** WHO
Displays who is online, and what they are doing.
**** VALIDATE
Allows the sysop or co-sysop to validate outgoing
network posts that are pending validation.
**** ONELINERS
Displays the "one-line" messages awaiting the user (ie
"Joe Public read your email...."), and then checks for
waiting email.
**** AUTOPOST
Displays the autoposts, and allows the caller to add
a message of their own, if they have the sufficient security
level as defined under VCONFIG Main Configuration.
**** LISTCALLERS <number of callers>
Displays on the screen the last <number of callers>
who have called and logged into the system. If numeric
expression <number of callers> is equal to zero, then all
of the current day's calls are listed.
**** ACCOUNT
Allows the caller to access the built-in account defaults
modification routine, so that they may change some of their
user account options, such as password, colors, etc.
**** S EDITFILE
A convenience command to allow the sysop to edit small
ASCII files (or ASCII files with heart-code) using the
built-in editor. This command should be restricted to
SYSOP USE ONLY.
**** S USEREDIT
A convenience command to allow the sysop to access the
user editor locally or remotely, through the BBS.
This command should be restricted to SYSOP USE ONLY.
**** S LOCALWFC
Displays the Local WFC Screen that the sysop can
call upon when logged into channel 0.
|
**** ! DBGROUP <database group id>
Sets the current database group, to the database group
identifier in string parameter <database group id>.
Executing the DBGROUP command sets special values
!90 to !92.
NOTE: DBGROUP should be executed before DB.
**** ! DB <database #>
Selects a database from the currently selected DBGROUP.
<database #> should be a numeric expression from 1 to !92.
Executing the DB command sets special values !93 to !99.
From there, you can determine which record number
to be used with subsequent LOAD or SEARCH commands.
**** ! SETEMAIL
SETEMAIL should be used, instead of the DBGROUP/DB command
combination, when you want to use the database commands
to manipulate/access the EMAIL database.
**** ! LOAD <record number>[, "/Q"]
Loads the database <record number> given into the current
special var workspace. If the /Q option is included,
the "new scan pointer" is not updated.
<record number> should be between 1 and !95.
NOTE: The LOAD command should not be issued until
DBGROUP and DB commands have been issued, selecting
a database to work with.
!22 can be examined to determine the outcome of the
LOAD command:
"OK" Record was successfully loaded
"PRI" Record was private and could not be loaded
"DEL" Record was deleted and could not be loaded
NOTE: The LOAD command should not be issued until
DBGROUP and DB commands have been issued, selecting
a database to work with.
**** ! SEARCH <record number to start>, <search type>, <search string>
Searches the currently selected database, starting
at the record number specified, using the <search type>
and <search string> given:
<search type> <search string>
1 Messages To User N/A
2 Message From User N/A
3 Subject Field Yes
4 Filename FileMask Yes
5 Filename Match Yes
!22 can be examined to determine the outcome of the
LOAD command:
"OUT" Data was not found
"<number>" Data Found !22 = Record Number
NOTE: The SEARCH command should not be issued until
DBGROUP and DB commands have been issued, selecting
a database to work with.
**** ! DISPLAYMSG
Optionally used after a LOAD or SEARCH command to display
the message header information on the screen.
NOTE: The DISPLAYMSG command should not be issued until
DBGROUP and DB commands have been issued, selecting
a database to work with, AND either a LOAD or SEARCH command
to load a data record.
**** ! DISPLAYTEXT <record number>
Display the text message associated with the database
<record number> given.
<record number> should be between 1 and !95.
NOTE: The DISPLAYTEXT command should not be issued until
DBGROUP and DB commands have been issued, selecting
a database to work with.
**** ! QS <new new-scan pointer>
Alters the users "new-scan pointer" (ie. !96) for the
currently selected database. <new new-scan pointer> is
a numeric expression.
NOTE: The QS command should not be issued until
DBGROUP and DB commands have been issued, selecting
a database to work with.
**** ! DEL <record number>
Mark a record for deletion in the current database.
<record number> is a numeric expression.
NOTE: The DEL command should not be issued until
DBGROUP and DB commands have been issued, selecting
a database to work with.
**** ! DBFLAG <record number>, <on/off>
Sets or resets the database flag bit for the entry at
the record given in numeric expression <record number>.
NOTE: The DBFLAG command should not be issued until
DBGROUP and DB commands have been issued, selecting
a database to work with.
**** ! ADDCOUNT <record number>
Adds 1 to the access counter for the database entry at
the record number given in numeric expression <record number>.
NOTE: The ADDCOUNT command should not be issued until
DBGROUP and DB commands have been issued, selecting
a database to work with.
**** ! SAVE <handle>, <user #>, <node address>, <network #>, <subject>,
<attached file size>, <attached filename>
Save a new record to the currently selected database. <handle>,
<node address>, <subject>, and <attached filename> are string
parameters; <user #>, <network #>, and <attached file size>
are numeric expressions.
If saving a record to a NETWORK # that doesn't use user #'s
such as the Internet or FIDOnet, then <user #> should be set
to zero.
If there is no file to be attached, then <attached file size>
should be set to zero, and <attached filename> should be set
to empty ("").
NOTE: The SAVE command should not be issued until
DBGROUP and DB commands have been issued, selecting
a database to work with.
**** ! BUFFER CLEAR
Clears the current text buffer workspace. This workspace
is saved as the message text with the SAVE command described
above.
**** ! BUFFER EDIT
Use the line editor to edit the buffer worksapce.
**** ! BUFFER LIST
Display the current contents of the worksapce buffer.
**** ! BUFFER APPEND, <data string>
Appends the string parameter <data string> onto
the current work space buffer.
|
**** SENDEMAIL
This calls upon a complete routine which handles the task
of allowing a user to send local or networked electronic
mail. This command is called from the default EMAIL.FB.
**** FEEDBACK
This calls upon a complete routine which handles the task
of allowing a user to send feedback to the sysop or any
address in your multi-feedback list, as configured in VCONFIG.
This command is called from the default EMAIL.FB.
**** READEMAILTO
This calls upon a complete routine which handles the task
of allowing a user to read mail that is addressed TO them.
This command is called from the default EMAIL.FB.
The user is given the option of reading mail based on:
(A)ll All Email Messages To User
(N)ew All New Email Messages To User
(S)earch Search the From: and Subject: Fields
(E)xt Srch Extended Search Includes Message Text
(L)ocal Email Written Locally
**** READEMAILFROM
This calls upon a complete routine which handles the task
of allowing a user to read mail that is addressed FROM them.
This command is called from the default EMAIL.FB.
The user is given the option of reading mail based on:
(A)ll All Email Messages From User
(N)ew All New Email Messages From User
(S)earch Search the To: and Subject: Fields
(E)xt Srch Extended Search Includes Message Text
(L)ocal Email Written Locally
**** QUICKMAIL
This accesses the complete routine which handles the
automatic sending of email using multiple mailing lists.
This command is called from the default EMAIL.FB.
**** S READALLEMAIL
This command should be executed by the SYSOP ONLY.
This command is called from the default SYSOP.FB.
It allows the sysop access to the entire email database.
|
**** LISTFILES
This command executes a complete routine which takes
a filename or filemask (wildcards allowed) from the user
and lists all matching entries in the current file base.
This command is called from the default FILE.FB.
**** SEARCHALL
Like LISTFILES, this command executes a complete routine which
takes a filename or filemask (wildcards allowed) from the user
and lists all matching entries for all file area databases within
the current TOPIC GROUP or all file area databases on the BBS.
This command is called from the default FILE.FB.
**** NEWFILES
This command executes a complete routine which lists all new
entries for all file area databases within the current TOPIC GROUP
or all file area databases on the BBS. This command is called
from the default FILE.FB.
**** FINDFILES
This command executes a complete routine which takes a text
string input from the user and lists all matching entries for
all file area databases within the current TOPIC GROUP or all
file area databases on the BBS. Entries are matched based on
the description. This command is called from the default FILE.FB.
**** DOWNLOADFILE
This command executes a complete routine which takes a filename
from the user and automatically tags these entries for
download. All file area databases are searched for the matching
file entry, starting with the current database. This command
is called from the default FILE.FB.
**** REMOTEUPLOAD
This command executes a complete routine which allows the
caller to upload one or more files. The caller has the option
of entering descriptions before or after the upload. In
addition, after the upload the routine will automatically
try to detect the FILE_ID.DIZ from any ARCS.CFG supported
archive type, and use that information for the description,
if possible. This command is called from the default FILE.FB.
**** TOPDOWNLOADS
This convenience command lists the top 50 downloads in
the current TOPIC GROUP. This command is called from
the default FILE.FB.
**** REVIEWFILE
This convenience command allows users to review files
sequentially (from the current file area database).
This command is called from the default FILE.FB.
**** RATIO
This convenience command simply display the caller's
upload/download ratio. This command is called from the
default FILE.FB.
**** DLMASTERLIST
This convenience command allows the user to download a
custom-generated masterlist of files. This command is
called from the default FILE.FB.
**** SETNEWFILESSCAN
This command lets the user sets the "days back" pointer
for their new file listings. This command is called from
the default FILE.FB.
**** S SYSOPUPLOAD
This command executes a complete routine which allows the
sysop to "upload" one or more files; that is, enter
the descriptions necessary to put files online and make
them available for download by callers. The routine will
automatically try to detect the FILE_ID.DIZ from any ARCS.CFG
supported archive type, and use that information for the
description, if possible, saving the sysop lots of time and
typing. This command is called from the default FILE.FB.
**** S REVIEWUPLOADS
If you have VCONFIG Main Option "Secure Uploads" set to "Yes"
then this command lets the sysop review the new files that have
been uploaded by users, before the file is accessible to
all users of the BBS. From this routine, the sysop can easily
move the file (and description) to the desired destination
directory.
|
**** SETQUICKSCAN
Accesses a complete routine that allows the caller to
manipulate their new-scan pointers for the public message
bases. User can choose to ignore message areas entirely.
This command is called from the default MESSAGE.FB.
**** READSEQMSG
Accesses a complete routine that will allow the user to
read messages sequentially, with an optional searching
capability, from the currently selected message base.
This command is called from the default MESSAGE.FB.
**** READNEWMSG
Read all new messages in all databases selected (as per
SETQUICKSCAN). This command is called from the default
MESSAGE.FB.
**** READNEWPERSONALMSG
Read only new messages in all databases selected (as per
SETQUICKSCAN), which are addressed TO: the user. This command
is called from the default MESSAGE.FB.
**** SCANMSG
Scan the current message base 10 messages at a time,
and allows user to switch into read mode at any time.
During a message base scan, the Title, From, and To
fields of a message are displayed. This command is
called from the default MESSAGE.FB.
**** POST
Execute a complete routine which allows the user to post
on the current message base. This command is called from
the default MESSAGE.FB.
|
**** LISTBASES
This command lists all of the databases available in the
current TOPIC GROUP.
**** SELECTBASE
This command lists all of the databases available in the
current TOPIC GROUP, and allows the user to choose a new
database for the current database.
**** CHOOSETOPIC
This command lists all of the available topic groups,
and allows the user to select a new TOPIC GROUP for
the current topic group.
**** PREVBASE
The PREVBASE command moves to the previous database within the
current TOPIC GROUP.
**** NEXTBASE
The NEXTBASE command moves to the next database within the
current TOPIC GROUP.
|
START.V is executed automatically when a user logs
into your BBS. To get other scripts to execute, one of three
methods can be employed:
1) From a Function Block
The first two lines of each function block file specify
the menu used (line 1) and the database TOPIC GROUPs
enabled, if any, (line 2) for this menu. Lines 3 onward
are used to define commands, and this is how to define a
command (/SCRIPT) which runs a script (SCRIPT.V):
/SCRIPT1 001 2 script1
2) From START.V or other Script
To end execution of the current script, and transfer control
to another script, use the LINK command, referenced elsewhere
in this document.
3) From the DEFAULT.S String File
You can embed references to Script files in most of
the external strings in the DEFAULT.S string file.
Strings which cannot be replaced are:
#19, 422, 423, 424, 425
How to execute script file SCRIPT2.V:
!script2
|
You have up to 260 simple variables for use. If you should
run out, feel free to use slots in the global array as simple
variables (ie. $0, $1, $2, and so on). The only limitation
is that global array slots cannot be used as the index variable
in a DO-LOOP structure.
Simple Variables and the Global Array Variable are NOT
automatically cleared when a script is started, or when the LINK
command is used to branch to another script. Therefore, you must
explicitly use the LET command to clear or zero any variables
which you want cleared.
>> let a = ""
>> let b = 0
This also means that you may pass information or data values
from one script to another.
Two important parts of each user's account record are
the "access flags" (!56) and "flags" (!57). The "access flags"
are used primarly for access-control to DATABASES and DOORS, as
configured through VCONFIG.EXE Database Configuration or
Door Configuration, or VMB.EXE set-up functions. You can
manipulate the access flags by manipulating !56, ORing (|)
or ANDing (&) a value to give the desired result. The
values for the flags A through Z are:
A 1 (2^0) J 512 (2^9) S 262144 (2^18)
B 2 (2^1) K 1024 (2^10) T 524288 (2^19)
C 4 (2^2) L 2048 (2^11) U 1048576 (2^20)
D 8 (2^3) M 4096 (2^12) V 2097152 (2^21)
E 16 (2^4) N 8192 (2^13) W 4914304 (2^22)
F 32 (2^5) O 16384 (2^14) X 8388608 (2^23)
G 64 (2^6) P 32768 (2^15) Y 16777216 (2^24)
H 128 (2^7) Q 65536 (2^16) Z 33554432 (2^25)
I 256 (2^8) R 131072 (2^17)
The total of all flags added together is 67108863.
For example, to turn on the I flag, use OR:
>> let !56=!56 | 256
To turn off the I flag, use AND:
>> let t=67108863 - 256
>> let !56=!56 & t
The other set of "flags" specify information about the user's
account, and govern access to network email (via NETWORKS.LST),
UUCP access, and Internet Pass-Thru access. These other flags
can be manipulated as !57, though a much easier way is to
use the SETFLAGS command documented earlier in this text.
The "flags" in use by the system are:
F - Full Screen Editor
X - Expert Mode (Menus Skipped)
N - User Has Been Sent New-User Email
I - Enable Internet Pass-Thru Access
U - Enable UUCP Access
|
|
|
|
|
|