Continuing from Part 1, this section will discuss Aliases. Aliases are shortcuts to abbreviate commands. Below is an example of some default aliases, with headings for easier reading. Notice that the headings are set of with nop which is programming lingo for “No Operation” or, more simply, “do nothing.” It is based off the default script created in part where we set up a default class template.

#class {cl_aliases} {kill}
#class {cl_aliases} {open}

#nop ###################################
#nop ## Aliases
#nop ###################################

#nop -=-=-=-=-=-=-= Class =-=-=-=-=-=-=-
#ALIAS {antipal}    {#read config/class/antipal.tin}
#ALIAS {mage}       {#read config/class/mage.tin}
#ALIAS {quessite}   {#read config/class/quessite.tin}
#ALIAS {warlock}    {#read config/class/warlock.tin}

#nop -=-=-=-=-=-=-= Quest =-=-=-=-=-=-=-
#ALIAS {qr} {quest request}
#ALIAS {qc} {quest complete}
#ALIAS {qi} {quest info}
#ALIAS {ql} {quest list}
#ALIAS {qs} {quest stats}

#nop -=-=-=-=-=-=-=  Env  =-=-=-=-=-=-=-
#ALIAS {ps} {portal set %1}
#ALIAS {ep} {enter portal}
#ALIAS {ud} {unlock %0; open %0}

#ALIAS {ec} {look in corpse}
#ALIAS {li} {look in %0}
#ALIAS {scc} {sac all.corpse}
#ALIAS {trash} {drop all.%1; sac all.%1}

#class {cl_aliases} {close}

Breaking this down, there are three main sections of default aliases: classes, quests, and environment. The class section is in anticipation of adding subsequent configuration files for class specific functions. We will see an example of those a little later once more of the *Tin features have been explained. The quest section has a naming convention that models the original commands. These aliases are merely abbreviations for commonly used commands. Typing qs will actually send quest status to the game.

The environment section is a little different. There are some abbreviated commands such as ep and ud; however, there are some that contain a list of commands. In *Tin++, input variables can be used to separate input values. For instance, take the trash command. If one were to enter trash sword every sword in your inventory would be dropped and subsequently deleted (or, sacrificed in UD lingua). The two commands are separated by the semicolon and the value “sword” is substituted in place of the %1. Let us say for instance that the command given was trash golden rod. In this case, every “golden” item would be dropped and sacrificed. This may not be the intended goal. One could therefore modify the alias to drop all.%1 %2; sac all.%1 %2 or simply use the %0 variable which lumps all arguments into one variable. Then, all “golden rod” would be dropped and sacrificed.

Let’s look at adding some logic to these basic aliases. Create a new section for other, miscellaneous aliases. We will play the role of a lover, not a fighter. Except when we see AnnoyingPlayer since they are, well, annoying.

#ALIAS {lover} { #if {"%0" == "AnnoyingPlayer"} {kill %0} {hug %0}}

This checks to see if your target is “AnnoyingPlayer.” If it is, you will attack them. Otherwise, you will give the player a hug. There are many, many different uses of aliases. TinTin++ has a great manual and a useful forum as well.

Previous: Part 1, Introduction

Next: Part 3, More Aliases