Aliases
Aliases
Aliases are a pretty standard feature in mud clients. BlowTorch provides a basic from/to alias replacement system that can be infinitely nested.
BlowTorch aliases can be almost infinity deep. As long as there are no circular replacements, they can be as many levels deep as you want.
Contents
- Create New Alias
- Modify/Delete Alias
- Save List
- Line Matching Options
- Alias Commands with Formatted Text
- Circular Dependencies
Create New Alias
Selecting MENU->Aliases will launch the alias selection dialog. Clicking New Alias will launch the new alias dialog.
Modify/Delete Alias
Long pressing an alias in the list will launch and alert for modifying/deleting the button. Selecting modify will launch the alias property editor with the fields filled in for the selected alias.
Save List
Currently the behavior of the app is to save/retrieve the full list of aliases. This is inconsistent with the button set editor or the trigger editor. In the future this will be changed, but for now, any changes made to the alias list will need to be saved by clicking the "Save List" button which will close the dialog.
Line Matching Options
In v1.1.1, aliases now have the ability to have thier matching behavior set. The default behavior is for aliases to match word boundaries (white space, punctuation, etc.) and this results in undesired behavior if you have an alias "i" for "inventory" and the command sent to the mud is: "chat i have to leave, thanks for the group!" will be transformed into "chat inventory have to leave, thanks for the group!" which is undesireable.
This can now be avoided by setting line matching options in the alias editor dialog. Checking both the options, Matches start of line (^) and Matches end of line ($) will make it so that the alias will only fire if it is the only text on the line or between semicolons. Only setting the "Matches start of line (^)" will give the desired result if only "i" is entered. However if the command looks like "i have something to do" it will still replace the leading "i", but this mode of operation can be useful for sending formatted text to the server. See the section below. The regular expression markers ^ and $ can be entered directly into the "Replace:" field, but will be stripped out and check the appropriate options automatically.
Alias Commands with Formatted Text
If the alias has "Matches start of line (^)" checked, and does not match the end of line, it will supply formatted text to the replaced text much like the trigger capture group replacement. Aliases of this form are entered as "alias arg1 arg2 arg3" and will replace arguments in the replacement text of the form $1, $2, $3 etc. With this funcionality it is possible to build shorthand, client-side "alias commands"
Example One:
Alias: "portal" replaces with text "get $1 bag; hold $1;enter $1;remove $1;put $1 bag"
Entering "portal crystal" into the input bar or from a button will cause "get crystal bag;hold crystal;enter crystal;remove crystal;put crystal bag" to the server
Example Two:
Alias: "money" replaces with text "give $1 coins to $2"
Entering "money 5000 dan" will cause "give 5000 coins to dan" to be sent to the server.
Circular Dependencies
I have tried to build a system to catch circular dependencies (resulting in an infinite loop) when entering new aliases into the system. The alias editor should highlight all offending aliases in red.
- Currently when offending circular references are found, the dialog does not prevent you from saving them and going about business as usual, however using one of the offending aliases will result in an infinite loop and crash the program.