Alias usage for MudMagic

I     Alias Definition
II    Alias Editing
III   Scope of Aliases
IV    Scripting Support
V     Alias Examples

I. Alias Definition
-----------------------
Aliases allow you to define shortcuts for simple commands. For example, you can define df to be an alias to drink from 
fountain, and then you can type only df in the command line, and drink from fountain will be sent to the mud. 
For speedwalk commands, you could input a single word such as RecallToThorn which will output the walk pattern to the 
destination you are attempting to get to.

There are two different ways to can set an alias. With basic matching and with regular expression matching. For 
example, if you want to pass a variable to your alias, such as: buying 10 potions or buying 10 loafs of bread, you can 
do this by using arguments in your input. Example:

Single alias argument:

Alias: ^bb
command: 
  print "buy 10 bread"

Regular Expression alias argument:
Alias: ^bb (.*)
command:
  IF $1 = "food" THEN
      print "recall;n;n;n"
      print "buy 10 bread"
  END

  IF $1 = "potion" THEN
      print "recall;s;s;s;w;s";
      print "buy 10 potion"
  END


II. Alias Editing
-----------------------
To edit an alias, you fill out the alias title, alias command, and select either a Python script or a local command 
script. For now, the 'Alias Title' is not used in the client - so inputing anything is fine. For example. To go from 
Recall to the location Thorn, a user will travel:  west, south, south, south, east, open door, east . To create an 
Alias that does all this for us, we go to our Alias editor and input:

Alias Title: Thorn
Alias : RecallToThorn
(select Use Script and in the open box area input)
print "west;south;south;south;east;open door;east"

And that's it. This above script assumes that you have set your command seperator argument to ';'. You can set your 
command argument seperator by visiting Settings -> Global Settings -> Strings and input the character: ; in the entry 
field.

The Alias: is either a basic input entry:  MyAlias  or a regular expression: ^Myalias (.*) (.*)

NOTE!:
The '^' before an alias name ensures that your alias name STARTS WITH the letter you input on the command entry. Or 
else if you have 
an alias such as:

test
rather than
^test

Every time you enter in a sentence with the word 'test' in it, the alias would trigger. For more help on using regular 
expressions, visit: http://perldoc.perl.org/perlre.html

III. Scope of Aliases
-----------------------
  Aliases can be stored as Local game aliases, or Global world aliases. Local game aliases are only available for that 
specific game you are connected to - whereas Global world aliases are available to any game you are connected to. For 
Global Alias editing - visit: Setting -> Global Settings -> Aliases. To edit your local game alias, visit: Profile -> 
Aliases when connected to a game.

  All aliases are stored and saved on a per-game basis. So each game has its own unique alias system. Global aliases 
are the only exception to this rule - where they are available to any game.

IV. Scripting Support
-----------------------
Aliases can use either Python or the MudMagic BASIC scripting language. For Python scripts - you would point to the 
file that contains your python script. For using MudMagic BASIC scripting, you would input the BASIC commands in the 
entry field. For more details on scripting, visit Help -> Inline Scripting for MudMagic BASIC or Help -> Python 
Scripting for Python script support details.

 V. Alias Examples
-----------------------
Aliases are simple direct command line replacements. With the use of Perl PCRE, you can pass arguments to the MudMagic 
command interpreter to perform some BASIC script support if desired. 


    Example 1:
	Alias Title: something1
	Alias:  Start Practice Session
	command:
	print "recall;u;n;n;e;prac"


        The above example will take you to a practicer and request the practices that you have. You can then create a 
	TRIGGER to get the output displayed and automatically practice any event that is less than a certain percentage.
	To make this alias work, you would input in the entry field:  Start Practice Session  . it is case sensitive 
	unless you use PCRE to make it otherwise in your Alias: definition.

   Example 2:
        Alias Title: something2
        Alias: DathlintoBaghannyBay
	command:
	print "w;w;w;w;w;w;w;w;w;n;n;w;w;w;se;se;se;s;s;s"

	The above example is a speed-walk alias that will take you from a location called Dathlin to a location called 
	Baghanny Bay. ( for KoTl players - this is a working alias =)

   Extended BASIC Script Example:
	Alias Title: something3 
	Alias: ^buy (\d*) (.*)
	command:

	REM : store how many items we want in a variable
	TOTAL_ITEMS = $1

	REM : store what we are buying in a variable
	ITEM = $2

	IF TOTAL_ITEMS > 10
	THEN
		$MESSAGEBOX "Trying to buy too much"
	ELSE
		IF ITEM = "bread" THEN
			send "recall;s;s;s;w;n";
        		send "buy $1 $2"
		ELSE 
			IF ITEM = "strength" THEN
				print "recall;s;s;s;e;n";
				print "buy $1 $2";
			ELSE
				print "I don't know where to find $2"
			END
		END
	END


	The example above does something different based on what you input. 
	If you input   buy 11 bread
                      -A popup window will state: Trying to buy too much
	If you input:  buy 5 bread
		      -The script will execute for the: ITEM = "bread" line
	If you input:  buy 5 strength
		      -The script will execute for the; ITEM = "strength" line
	If you input   buy 5 tomatoes
		      -You will see on the client "I don't know where to find tomatoes"

