Regnus 5.5

The Random Text Scripting Language

The Regnus Scripting Tutorial

Part 1: Your First Regnus Script

Welcome to the tutorial for the Regnus scripting language! Regnus is a powerful recursive language for the generation of random text, and can be used for a wide number of applications. Before you start this tutorial, it is recommended that you try playing with some existing scripts to give yourself some idea of the capabilities of the language!

Note: This tutorial is also available to view or to download as a self-contained one-page portable HTML file!

So, to begin with, let's get started by creating your very first Regnus script!

First, open a text editor of your choice. For instance, the Windows Notepad will do at a pinch (although Edit Pad Lite is a much better option for any serious text-editing).

Create a new plain text file in your editor, and give it the file extension ".rsf" - this stands for "Regnus Script File", and is the standard file extension for Regnus scripts.

Into this file, paste the following:

START <First Label>Hello world!

Now, open this script with your Regnus parser and click to generate some text. You will see that the text presented to you by the parser is the sentence "Hello world!" - the entire line of text from the file, except for the part enclosed in triangular brackets and the first word of the line.

Now try this:

START <First Label>Hello brave new world!
START <Second Label>Goodbye cruel world!

You should now be given a selection of two options from the parser's contents menu: "First Label" and "Second Label". Go ahead and select one, and generate some text!

These line identifiers (the parts in triangular brackets) are called "labels", and they tell the parser that it can start parsing from that line, as well as letting it know what that option should be called!

Labels do not have to appear at the beginning of the line; they are just as welcome at the end, or at any point in between! So, for instance, the following will work just as well:

START Hello brave new world!<First Label>
START Goodbye cruel <Second Label>world!

...Though it probably goes without saying that it is considered bad practice to insert labels haphazardly in the middle of sentences like that!

Of course, a line with no label will not appear as an option in your parser's contents list. In the following script, the parser will never display the unlabelled line:

START <First Label>Hello brave new world!
START <Second Label>Goodbye cruel world!
START This line does not have a label, and so will never be displayed!

Those five-letter words at the beginning of each line of the file are called "qualifiers", and they are also important: every line in a Regnus script file must start with a qualifier, which lets the parser know what kind of information is contained in that line...

More on that shortly though!