DIYIGM40.TXT - ASCII copy of the DIYIGM.DOC file.
Created December 20, 2005 using Microsoft Word for Windows.
===========================================================

                           DIY IGM (LORD IGM) v4.00
 
                           Do-It-Yourself IGM maker

                            Do-It-Yourself product

                        Main programmer : Teng Junbin

                                 Contents:

                               Introduction
                                  License
                                Disclaimer
                                   Files
                            Registration Benefits
                                   Usage
                                Script making
                           Command-line Parameters
                             Registration Form
                               Special Offer
                                

Introduction:

        DIYIGM is a rather big IGM, with a lot of powerful functions.  With
it, you can create your own IGMs and even distribute them!  Of course, like
all good stuff, this is a shareware...



License:

        Non-whatsoever.

        You can hack it yourself to make it registered, get a commercial hack
somewhere, pay me to register it or just don't register it.  The choice is
yours and I WILL NOT sue you, scold you, hit you or do anything bad towards
you, your computer or your relatives.  However, I would greatly appreciate it
if you register it by sending me $10 (only!).  Information below.



Disclaimer:

        Non-whatsoever (Yep, again!)

        I do not (and WILL NOT) take any resopnsibilities of any kind if this
program misbehaves (eg. Burn your house down, introduce a virus, start World
War III, allows aliens to attack Earth....).  However, I would appreciate it
if you tell me of any bugs in the program (Not creepy crawlies.  When I say
bugs, I mean program errors!).  When a error occurs however, a little message
may appear telling you of an error code.  REMEMBER IT!


        Then, if you are a programmer, you can check out what the code means
with Qbasic.  If not, you can try contacting me.  Please note: technical help
only availible to registered users!

Files:

        The following files should come with the package:

Diyigm.exe             The main program
Instdiy.exe            The installation program
Diyigm.doc             The document file (This one!)
Qwkigm1.dat            Sample Config file for node 1
Help.dat               Help file on script making
Products.lst           A list of all DIY products as of the date this file is made
Filer.exe              The program which you MUST run before running DIYIGM. Information at the back.

        Files needed to run the program are:

Diyigm.exe
Instdiy.exe
Filer.exe
*.ins            The "*" stands for the file name of the script IGM
*.dat            The "*" stands for the file name of the script IGM
Diyigm.?         The "?" stands for the node number
Qwkigm?.dat      The "?" stands for the node number

        The following files are made by either the installation program or
the IGM:

Paths.dat               The paths to LORD ans The Sewers
Temp.tmp                A temporary file.  If you find this file, do not delete it!
Option.tmp              A temporary file.  If you find this file, do not delete it!
Options.tmp             A temporary file.  If you find this file, do not delete it!
Diyigm.bat              The batch file to run from LORD
Qwkigm.err              If an error occurred, the error reporting routine will write to this file

Registration Benefits:

        When you register, there will not be a unregistration delay and you
will also be able to receive technical support.

        AND you will get the nice warm feeling you always get when you
register something.

Usage:

        Make a new directory for DIYIGM.  Copy all the files into that
directory and type instdiy.exe <NAME OF SCRIPT TO INSTALL> followed by enter.
This will start the installation program.  Just follow the prompts.  The file
"QWKIGM1.DAT" is a sample config you can use.  If you delete it, you need to
make another one.


NOTE: Each node needs it's own config file!
NOTE: When you press "I" in the installation program to install the IGM, the
      file "DIYIGM.BAT" will be created.  If it is not in the IGM directory,
      move it there.

Script making:

        To make a script IGM, you must make 2 files.

        One with the extension "INS" and one with the extension "DAT"

        The one with the extension "INS" is the installation file, used by
Instdiy.exe.  The other the script file used by the main program.

        In the "INS" file, you must type in:
Line 1:  %NAME:<NAME OF IGM WITHOUT LORD COLOUR CODES>
Line 2:  %LNAME:<NAME OF IGM WITH LORD COLOUR CODES>
Line 3:  %VER:<VERSION NUMBER>
Line 4:  %PRINT:<THE TEXT TO PRINT IN LOGNOW.TXT WITH LORD COLOUR CODES>
Line 5:  <THE NAME OF THE "DAT" FILE>

E.G:

%NAME:King Arthur's Palace
%LNAME:`6King `9Arthur's `@Palace
%VER:1.00
%PRINT:`$King Arthur has set up a palace in Other Places... Visit it today!
KINGA.DAT

        In the "DAT" file, the first three lines you must type are:
Line 1:  %NAME:<NAME OF IGM WITHOUT LORD COLOUR CODES>
Line 2:  %VER:<VERSION NUMBER>
Line 3:  {MAIN}

E.G:

%NAME:King Arthur's Palace
%VER:1.00
{MAIN}

        Following that, the fun begins!

Every command is appended after a "%" symbol (E.G: %CLS). Options are appended
after a "^" symbol (E.G: ^AGOTO ACE).

NOTE:  Commands are instructions for DIYIGM.EXE on what to do
NOTE:  Options are single key letters or numbers that DIYIGM.EXE prompt the
       user to enter at the end of most modules
NOTE:  Modules are different part of the script IGM (such as Ye Olde Bank in
       LORD)
NOTE:  Variables are label that contains information





%NAME:King Arthur's Palace
%VER:1.00
{MAIN}
%CLS
%LPRINT09Hello! Welcome to King Arthur's 
Palace!
%LPRINT09Here at King Arthur's Palace, we 
aim at getting the best to be the best and
%LPRINT09the bad to be good.
%LPRINT09Please choose a place to go.
%LC1|0
%LPRINT141. Visit the King
%LPRINT142. Test for fairies
%LPRINT143. Go to the armory
^1goto king
^2goto fairy
^3goto armory
{END}
{KING}
%LPRINT11The King does not wish to see you!
%MORE
%TERMINATE
{END}


{FAIRY}
%TFAIRY
%IF S=YES|LPRINT12You have a fairy!
%IF S=NO|LPRINT12You do not have a fairy!
%MORE
%TERMINATE
{END}
{ARMORY}
%USER.STR
%PRINT09Your strength point is :
%PRINTVARS
^1Goto add
^2Goto minus
^3TERMINATE
{END}
{ADD}
%+USER.STR1
%GOTO ARMORY
{END}
{MINUS}
%-USER.STR1
%GOTO ARMORY
{END}





Complex?  Nay... All it does is let the user go around... nothing much


Colour codes:

                        Foreground color
                        0 -black                        1 -blue                        2 -green                        3 -cyan
                        4 -red                        5 -magenta                        6 -brown                        7 -white
                        8 -grey                        9 -light blue                        10-light green
                        11-light cyan                        12-light red                        13-light magenta
                        14-yellow                        15-bright white
                        Bigger than 15 = 15
                        

                        Background color
                        0 -black                        1 -blue                        2 -green                        3 -cyan
                        4 -red                        5 -magenta                        6 -brown                        7 -white
                        Bigger than 7 = 7

Command-line Parameters:

        Command-line parameters of Diyigm.exe are:

   /CP<path>  The FULL pathname to the IGM executable.   (REQUIRED)
              eg... /CPC:\LORD\IGMS\CASTLE\CASTLE.EXE

   /N<#>      Node number.                               (REQUIRED)
              eg... /N1

   /HS<#>     Hardware handshaking mode. Range 0 to 3    (OPTIONAL)
              eg... /HS2

              Where:  0=None (Default)
                      1=XON/XOFF
                      2=CTS/RTS
                      3=BOTH XON/XOFF & CTS/RTS

              If users are having display problems, try /HS2

   NOTE:
   When editing the IGM commandline,  the /CP parameter MUST follow  the
   executable path, and all parameters must be given in the order listed 
   above.  If you botch this up,  I guarantee you are going to curse the
   program. YOU HAVE BEEN WARNED!

        Command-lines parameters for FILER.EXE are

   FILER.EXE <NODE> <FILENAME OF DATA FILE>

        Command-lines parameters for INSTDIY.EXE are

   INSTDIY.EXE <FILENAME OF INSTALL FILE>


Building an IGM, the sloggers guide!

Firstly create the *.ins file like thus:

%NAME:
%LNAME:
%VER:
%PRINT:
<NAME OF DATA FILE>

E.G:

%NAME:King Arthur's Palace
%LNAME:`6King `9Arthur's `@Palace
%VER:1.00
%PRINT:`$King Arthur has set up a palace in Other Places... Visit it today!
KINGA.DAT

Now we create the *.dat file (Which has been refered to above....)

User.Variables
User.Variables are variables containing information on the user.

To access a variable, say FOREST, type

%USER.FOREST

NOTE: Do no type in the brackets and the number in the brackets!

Now the variable %S will contain the information of USER.FOREST (say, 9)

Therefore, when you print the variable %S, the digit 9 appears.  Of course, you can do a lot of other 
things... but then, we will not discuss them here. 
Remember, let your imagination run wild!

Variables with "*" in front of them are accumulative variables and you can perform mathematics 
operations on them (Plus and Minus)

Variables with "S" in front of them are strings variables.  The number behind very string variable is the 
maximum number of characters the string can hold.

E.G:  USER.HANDLE can hold up to 20 characters.



                               USER.VARIABLES:

S       Handle          User handle in LORD(20)   
S       Realname        User realname(50)
*       Hp              User hitpoints(32767)
*       Hitmax          User hitpoints maximum(32767)
*       Wpn             User Weapon number(15)
S       Weapon          User Weapon name(20)
        Smaster         Has the user seen his master?(5)   5 = YES     0 = NO
*       Forest          Forest fights left(32767)
*       Human           Human fights left(32767)
*       Gold            Gold on hand(2,147,483,647)
*       Bank            Gold in bank(2,147,483,647)
*       Defend          Defense points(32767)
*       Str             Strength points(32767)
*       Charm           Charm points(32767)
        Sdragon         Has the user seen the dragon?(5)   5 = YES    0 = NO
        Sviolet         Has the user seen Violet(5)        5 = YES    0 = NO
*       Level           User level(12)
*       Armnum          Armour number(15)
S       Arm             Armour name(20)
*       Gem             Number of gems(32767)
*       Exp             Experience points(2,147,483,647)
        Sex             Sex(5)                           5 = Female  0 = Male
        Sbard           Has the user seen the bard?(5)   5 = YES     0 = NO
*       Lays            Number of lays(32767)
        Class           What is the user(3)   1 = Death Knight  2 = Magician 3 = Thief
        Horse           Does the user have a horse?(1)     1 = YES     0 = NO
        Marr            Is the user married?(149)-1 = NO    else YES  If yes, this number = the account number
                                                                                                    of the player this user is married to
*       Kids            How many kids?(32767)
*       Death           How many death knight skill points?(40)
*       Magic           How many mystical skill points?(40)
*       Thief           How many thieving skill points?(40)
*       Deathu          How many death knight skill points left?(40)
*       Magicu          How many mystical skill points left?(40)
*       Thiefu          How many thieving skill points left?(40)

E.G: %USER.THIEF
     ^^^^^^^^^^^ This will put the number of thieving skill points the user has into the %S variable
E.G: %=USER.THIEF12
     ^^^^^^^^^^^^^^ This will give the user 12 thieving skill points
E.G: %+USER.THIEF1
     ^^^^^^^^^^^^^ This will give the user an additional 1 thieving user point
E.G: %*USER.THIEF10
     ^^^^^^^^^^^^^ This will give the user ten times more thieving user points than he has now
E.G: %\USER.THIEF2
     ^^^^^^^^^^^^^ This will divide the user's thieving skill in half
E.G: %+USER.THIEF1
     ^^^^^^^^^^^^^ This will give the user an additional 1 thieving user point
E.G: %-USER.THIEF1
     ^^^^^^^^^^^^^ This will take one of the user's thieving user points


Touch variables
Touch variables are variables that you can use to store temporary information.  They are all string 
variables!

%A
%B
%C
%D
%E

E.G: %A=I am a boy  Will unsurprisingly store I am a boy in %A

System variable
The system variable is a variable containing replies from system events, such as %USER.THIEF It is a 
string variable!  It is %S

Identification variables
Identification variables are variables containing information DIYIGM.EXE needs in order to access your 
script IGM.  They can only be edited once and must appear at the top of the script IGM, with "%NAME" 
first, followed by "%VER".

%NAME: <NAME OF SCRIPT IGM>
%VER:  <VERSION NUMBER>

E.G:
%NAME:King Arthur's Palace
%VER:v1.00

Labels
Labels are part of a module, telling the program where to go.

{MAIN}   <NEEDED AS THE THIRD LINE OF ALL SCRIPT IGMS>

E.G:
%NAME:King Arthur's Palace
%VER:v1.00
{MAIN}

When the program starts, it will look for {MAIN}.  Any command between it and {END} will be counted 
as commands for {MAIN} and will only work there

{END}
End tells DIYIGM.EXE that the end of a module has been reached.

Other module names can be invented by yourself.  They can contain up to 20 characters.
E.G:
{IAMASUPERHUMAN}   (Spaces in labels are not allowed!)


Options
Options are instruction telling DIYIGM.EXE what can be pressed and what can't They always begin with 
a ^.  Once an option appears, no other commands, other than other options can appear in that module!

E.G:
{MAIN}
%PRINT09Hello!
^2GOTO DDD
^5GOTO IAM

If a module does not have a goto command or a terminate command at it's end, then it must have at least 1 
option!

Goto
The Goto command is used to transfer control from one module to another.

E.G:
{MAIN}
%GOTO ADD   _____   From here
{END}           |    jump to
{ADD}       <---|     here!
%TERMINATE
{END}

Col
The Col command is used to change the background or foreground colours.  It can also be used to make 
text blink.
E.G:
%COL0941

First two numbers = foreground colour  (Must be 2 digits! 9 = 09)
Next number = background number
Last number = Whether to blink or not. (1 = blink, 0 = no blink)

More
Sends a "<MORE>" prompt to both remote and local consoles and wait for a key to be pressed.
E.G:
%MORE

Press
Same as MORE but instead of "<MORE>", the string "Press any key to continue" appears.
E.G:
%PRESS

Print
The Print command prints a message to both local and remote consoles.
E.G:
%PRINT10Hello World!
First two digits = foreground colour codes (must be 2 digits!, 9 = 09)
The remaining characters are printed

Lprint
Same as PRINT, but a carriage return and line feed is added to the end of the message
E.G: %PRINT09Hello World!


Terminate
Terminate the IGM.  (Save changes to user stats)
E.G:
%TERMINATE

Terminate0
Terminate IGM.  (Do not save changes)
E.G:
%TERMINATE0

Cls
Clear screen
E.G:
%CLS

Lc
The LC command makes the cursor move.
E.G:
%LC3|6

Digit(s) before "|" = number of rows to move down
Digit(s) after "|" = number of columns to move right

If
The IF command compares a string with a given variable and preform an action both are the same or if 
one is bigger than thr other
E.G:
%IF A=DIE|GOTO ADD
%IF A>DIE|GOTO ADD

First character = Touch variable name
Second character = Operation type  (= > <)
Remaining characters before "|" = String to compare the touch variable with
Command after "|" = Will be performed if touch variable = string.
E.G:
%A=DIE
%IF A=DIE|PRINT15HELLO!

The output will be the word "HELLO!" printed in bright white

Warrior
The WARRIOR command prints the user's name in colour if ANSI is present and prints the user's name 
in ascii if ANSI is not present.
E.G:
%WARRIOR

Fairy
The FAIRY command is used to give or take a fairy from the user.
E.G:
%FAIRY0
This will take a fairy from the user
%FAIRY1
This will give the user a fairy


Tfairy
The TFAIRY command is used to test whether the user has a fairy
It will write "YES" to the variable %S if the user has it
It will write "NO" to the variable %S if the user doesn't has it
E.G:
%TFAIRY

Printvar
The PRINTVAR command is used to print a touch or system variable
E.G:
%PRINTVARS
This will print the system variable

%PRINTVARA
This will print touch variable A

Vtv
The VTV command is used to pass information from a touch variable or the system variable to a user 
variable
E.G:
%VTV=A=USER.STR
%VTV=S=USER.STR

Rand
The RAND command is used to generate a random number.
E.G:
%RAND15
15 being the biggest number that the random number can be. The result will be put in the %S variable

Displayfile
The DISPLAYFILE command is used to print a pre-defined menu, stored in a file.
E.G:
%DISPLAYFILEDDD0
            ^^^-

^ = File name (WITHOUT EXTENSIONS!)
- = Should the screen be cleared first?   0 = NO   Others = YES

In order for this command to work, you need to have two files.  One is the ANSI file and the other is the 
ASCII file.  Both have to be in the current directory.
ANSI file, extension = CLR   (E.G: DDD.CLR)     ASCII file, extension = BBS   (E.G: DDD.BBS)

That?s it really, kinda simple but then again it?s supposed to be....
