Subject: Re: BBS package From: morley@suncad.camosun.bc.ca (Mark Morley) Date: 11 Sep 1993 12:50:22 PDT
Hello all,
As some of you know I've been working on developing a BBS under Linux for
a while now. I thought I'd let y'all know what's new.
After bringing my C based BBS up to about %70 of what I want (need) it to
do, I've scratched it and started over. What I'm now writing is a new
programming language called M-Script that is designed specifically for
writing BBS's and or MUD's. I'm re-writing my BBS in M-Script.
M-Script is an interpreted language that looks very similar to dBase. It
is very tightly written and is very fast (although I don't really have
anything to compare it to). The interpreter executable is only 40K,
although that will grow a little bit as I add more commands, etc.
Why M-Script over regular shell scripts? It's simply easier to write a
BBS in M-Script. Little knowledge of UNIX and none of C is required. I
also plan on porting it to DOS so that the scripts will run directly under
either Unix or DOS. Also, with many Internet applications built in, you
have more control over how your (usually expensive) resources are used.
A prime example is FTP. In M-Script you can give your users a menu of
files that are available, say, at sunsite. They can tag all the ones they
want and those selections are saved (or retrieved immediately - whatever)
At midnight or so a cron job can be run that retrieves all the users'
files, and mails them a report of the transactions. I think you get the idea.
Just some of the commands you find in M-Script include:
ftpopen/ftpclose/ftpcd/ftpdir/ftpput/ftpget/etc: Built in FTP commands.
mail: mail a file to someone.
browse/cbrowse: Allows a user to view a file and scroll it in BOTH
directions with the arrow keys, etc. The 'c' version will interpret
special codes in the file to manipulate colors, embed variables, etc.
The non-c version does not interpret these codes. An example line
containing some of these codes might look like this:
\tLWelcome to ISLAND-NET ~FIRSTNAME~! You've called ~CALLS~ time\s before.
The '\tL' sets the color to yellow, the ~FIRSTNAME~ is replaced by the
value of the M-Script variable FIRSTNAME. ~CALLS~ is replaced by the
value of the CALLS variable. The \s will print an 's' only if the last
variable printed was not equal to '1'. There are dozens of such codes
that can be used. Also, variables can be left or right justified, padded,
etc. For example: ~FIRSTNAME>30~ would display the value of FIRSTNAME
right-justified in a 30 character space.
list/clist: Allows the user to view a file in a more "traditional" manner.
Kinda like the 'more' command - one screen or line at a time. Again,
the 'c' version interprets codes and variables.
who: Displays a list of who's on the system. You can customize the way
this display looks by setting the WHOHEADER, WHOENTRY, and WHOFOOTER
variables.
finger: embedded finger command. Works just like the real finger.
print/cprint/nprint/ncprint: Display a line of text on the user's
screen. Again, the 'c' versions interpret codes. The 'n' versions do
not print a CR/NL after the text, the others do.
shell: shell out and run some other program. Useful if you want to
run elm or tin or something...
colors: turn ANSI colors on or off, or toggle the current value.
pickone: allows the user to pick one value from a list of values. For
example, the statement 'pickone choice Yes,No,Maybe' would display the
string 'Yes' on the user's screen. When s/he presses the space bar, it
changes to 'No', then to 'Maybe', then back to 'Yes', etc. When the
user presses enter the current value is stored into the variable 'choice'.
input: read a line of text from the user and store it in a variable.
This allows full editing of the string with the arrow keys, etc.
There are many many others that manipulate variables (case conversion,
parsing, etc), manipulate the display (clear, cursor positioning, etc),
manipulate files (delete, copy, move, rename, etc) and directories (cd,
md, rd, etc). It also has commands to open a file, read from it, search
it, close it, etc. There are some limited database like functions as
well (I hope to expand the database commands quite a bit).
For program flow M-Script currently can deal with while loops and
if/elif/else statements. Nesting is not a problem. I plan on adding a
switch/case command this week. I'll probably add some sort of for loop
as well. Oh, you can also include another M-Script file with the
"include" statement.
Finally, M-Script allows you to define new procedures and call them
throughout your program. You can pass arguments to procedures, and
procedures can return results. The first procedure I wrote in M-Script
was yesterday. I called it PrintOut. It takes a single filename as an
argument. The file is displayed on the screen on what looks like one
of those green and white striped computer print outs (tractor feed
holes, perforated edges, etc.) The neat thing is I can call PrintOut
at any time, giving any filename as an argument, and voila! I need no
special codes in the file at all - it's just plain ASCII. This is just
one example of what you can do with procedures.
Miscellany: Every command can be abbreviated to the first 2-3 characters,
supports comments (of course), some limited debugging (line echoing and
statement stepping), etc.
Anyway, that's all I've got so far, but in a week or two M-Script should
be a pretty sophisticated language. I'm always open to ideas and
constructive criticism. Questions anyone?
In a week I'll be willing to give out a half dozen or so binaries of
M-Script to beta-testers, if anyone's interested. Drop me a note.
Mark
morley@camosun.bc.ca