Virtual Advanced | Features | Download | Documentation | Support
Programming with VScript

This article will give you a good understanding of what procedures and standards I use to write a new program from scratch. I will express a lot of my own ideas and opinions that I have developed over the years in this article.

VScript?
If you do not know anything about the VBBS or VADV software, then you might be thinking that. VScript is a powerful scripting language that allows you to write games and utilities to work with the BBS software. This is a unique part of the software that hasn't been matched by any other BBS software yet. There are other BBS programs that have a built-in script language (such as RA and Mystic), but their script language isn't the center of the whole program. Yes, Synchronet does have a script language that runs most of the BBS, but it is overly complicated and is missing needed commands. So in other words, VBBS and VADV contains the easiest to use, most powerful script language out there.. You can essentially rewrite the whole BBS yourself to do whatever you can imagine, and not have anything to resemble what you started with. I have done major modifications with my Design BBS, but that is only a small part of what you can do. (Note: As of 8-2-02, the Design BBS lightbar menus are actually comprised of 76 individual scripts written my myself, and one (1) function block to run them all. The BBS is running a total of 129 custom scripts and eight (8) function blocks!).

Now why would you want to program in a script language instead of making the same programs with a major language such as Pascal or C? The scripts allow you to have access to variables and databases that would be out of reach of other languages.

VBBS vs. VADV Scripting Languages
Which one is better? That is hard to say. To make it simple, the VBBS language is far easier to program in since you can name variables with descriptive names ($config_file means more to me than A0), but VADV is more powerful. VBBS programs must be compiled before they can be ran, whereas VADV's programs are read straight from the source code. To compromise between the two, there happens to be a program called VSCX which will convert VBBS programs for use with VADV. It was originally used to help SysOps who were running VBBS to switch over to Virtual Advanced when it was first released. I use this program so I can do all of my main programming with VBBS and when the code is debugged, I can convert it for use with VADV. This also allows me to release the same programs for both software without doing any additional work.

Unfortunately there are some problems with the conversion. VSCX doesn't interpret some of the original code correctly so I must edit the VADV version before it can be read. The most common problems are:

1) Any instances of "" in the VBBS code will be left blank in the VADV code. I have to edit the VADV code and manually add the double quotes.

2) You must check any INSTR statements in the new VADV code and add quotes around the token that you are searching for.

3) It is highly recommended that you use a variable to define SHELL commands. I.E.:

$SHELL = "COMMAND"
SHELL $SHELL
instead of
SHELL "COMMAND"

4) Do the same for BUFFER APPEND commands as number three above.

5) DO WHILE loops in the VBBS code do not get converted correctly.

6) SAVE commands in the VBBS code are not converted correctly. A comma is missing from the first variable.

7) Anywhere a $NODE variable is used in a VBBS script, in the converted script it will be 1517005. This was apparently the VSCX author's VNet node number. Just replace it with your VNet node number (default is 0 if you haven't changed it).

It only takes a minute to correct these problems. VSCX comments the original code in the VADV code, so I can quickly search for those commands and fix them. Now, all of those comments are really good to debug the VADV program and to make sure that it works properly, but that amount of comments will slow the output down considerably! So, I wrote a program called RemCom (Remove Comments) that will scan the converted program and remove all of those comments, and take out the added LOG commands. It takes a second to run this program and you will notice a difference when it is finished.

I am now only writing programs in the VADV script language, but will do custom scripts in VBBS's language if requested.

The Standard
I wrote a VScript standard a few years ago when I noticed that everyone's code was very different from each other. Some people capitalized everything, where other people wouldn't capitalize anything. Some code had tabs of 8 spaces, others didn't indent anything. Other code was horrendous... including my own early stuff. I figured that if all the VScript programmers would agree to a set standard then we all could benefit from each other's work. You can download the standard here. It needs a few updates, but for the most part I still adhere to it very closely.

You Can Help!
If you find these programs useful, you can show your support by donating - even a small amount. To help out, click the PayPal button below.

Home : News : Products : Downloads : Community : VirtualNET : Development : Support : About : Contact : Bug Reporting