Previous Index Next


5 Interfaces and Profiles

Table of Contents


Axmud offers powerful triggers, aliases, macros, timers and hooks to enhance your playing experience. Collectively, they are called interfaces.

Triggers respond to text received from the world.

Rewriter triggers are a special kind of trigger that modify the received text before it is displayed. (They don't send a world command, as normal triggers do.)

Splitter triggers are a special kind of trigger that split a line into two or more separate lines. Like rewriter triggers, splitter triggers don't send a world command.

Aliases respond to world commands, before they are sent to the world.

Macros respond when you press a certain key (or a combination of keys).

Timers do something repeatedly, or wait for a period of time before doing something.

Hooks respond to certain hook events.

In the next Section we'll talk about how to create new interfaces. Because Axmud interfaces are so powerful, we first need to discuss the way they are stored, and then we need to discuss how Axmud uses special patterns called regular expressions (the term regular expression is often abbreviated to regex).

5.1 Profiles

Axmud interfaces (triggers, aliases, macros, timers and hooks) often 'belong' to a particular profile.

Most of the time, interfaces belong to a world profile, which means that the interfaces are available every time you connect to that world (and are not available when you connect to any other world.)

It's also possible for interfaces to belong to a character profile, which means that the interfaces are only available when you connect using that character.

The key points to understand are these:

  1. If the current world and the current character both have a trigger called mytrigger, only one of these triggers can be active
  2. The other one is classed as inactive, which means it is ignored
  3. All of this happens auto-magically. Your only concern is to make sure you have set the correct current character

5.1.1 Adding profiles

An easy way to add a new character profile is by using the ;addchar command. (We've already discussed several other ways.)

    ;addchar bilbo
    ;ach bilbo

If you don't want to type the password every time you use this character, you should specify it now:

    ;addchar bilbo mypassword

You can use the following command to list all character profiles for the current world. (For obvious reasons, it doesn't display passwords.)

    ;listchar
    ;lch

5.1.2 Setting current profiles

Now, to make this character profile the current one, use the ;setchar command:

    ;setchar bilbo
    ;sch bilbo

If a profile for the Bilbo character doesn't already exist, it is created. You can also use this command to set (or change) the character's password:

    ;setchar bilbo newpass

5.1.3 Deleting profiles

The command to delete a character profile is, unsurprisingly, ;deletechar.

    ;deletechar bilbo
    ;dch bilbo

If Bilbo is the current character, there will no longer be a current character. You'll have to set a new current character with ;setchar.

Similar commands can be used with world profiles:

    ;addworld deathmud
    ;awo deathmud

    ;setworld deathmud
    ;swo deathmud

    ;deleteworld deathmud
    ;dwo deathmud

There is one important restriction. Axmud insists that there is always a current world. You can't use ;deleteworld to delete the current world profile.

5.2 Guild and race profiles

Besides world and character profiles, Axmud provides guild and race profiles as standard.

Guild profiles divide characters into clubs: one guild for warriors, another for wizards, another for thieves, and so on. It doesn't matter if the world calls these divisions classes, or clans, or anything else - Axmud refers to them as guilds.

At most worlds, the word race is used in the Tolkienesque sense of a species. Race profiles commonly exist for humans, dwarves, trolls, elves and so on.

If you're using a pre-configured world, you probably already have a selection of guild and race profiles to choose from:

    ;listguild
    ;lg

    ;listrace
    ;lr

Otherwise, you'll have to use commands like ;setguild and ;setrace. You only need to set the current guild and race once - after that, every time you log in as Bilbo, the correct guild and race profiles will be set automatically.

5.3 Custom profiles

We've discussed world, guild, race and character profiles, but for some worlds it might be convenient to create other categories of profile. For example, at a MUD which divides players into factions, a character might belong to a guild, a race and a faction.

Axmud is able to create new kinds of profile. The blueprint for a new kind of profile is called a profile template, and profiles based on it are called custom profiles. If you're interested to find out more, read the help for these client commands:

    ;help addtemplate
    ;help addscalarproperty
    ;help addlistproperty
    ;help addhashproperty
    ;help addcustomprofile

5.4 The profile priority list

Assuming you haven't created any custom profiles, your current profiles might now look something like this:

    WORLD:      deathmud
    CHARACTER:  bilbo
    GUILD:      thief
    RACE:       halfling

When we create interfaces (triggers, aliases, macros, timers and hooks), they usually 'belong' to a profile. Most of your interfaces will belong to the world profile.

Now, imagine that we have four different triggers, each with the same name (mytrigger) and each belonging to one of these profiles. As we mentioned above, only one of them can be the active trigger. The others are all treated as inactive triggers.

How does Axmud choose which trigger is the active one? The answer is simple: it's the one which belongs to the character. Axmud specifies that the character profile takes priority over other categories of profile.

The profile priority list looks like this:

    HIGHEST PRIORITY    character > race > guild > world    LOWEST PRIORITY

When Axmud is deciding which mytrigger is the active one, it first looks at the current character profile. If it has a trigger called mytrigger, that's the active trigger.

If not, it looks at the current race profile. If that profile has a trigger called mytrigger, that's the active trigger. Otherwise it checks the current guild profile, and then the current world profile.

Now we get to the clever bit:

You can create hundreds of different profiles. You can change the current guild as often as you want or change the current character as often as you want (even in the middle of a session). Each of these many profiles can have their own trigger called mytrigger.

And even though there are hundreds of triggers with the same name, only one of them is ever active.

Whenever you add, delete or modify a trigger, whenever you add, delete or modify a profile, whenever you set a new current profile, Axmud automatically marks just one trigger called mytrigger as the active one.

No effort is required by you. It all happens auto-magically.

5.5 Interfaces in practice

In practice, you'll usually have only one trigger called mytrigger, and it will belong to the current world.

Suppose this trigger fires when Axmud receives a line containing the text You kill. The trigger's response might be

    get coins from corpse

This might be fine for most guilds, races and characters. We can think of this trigger as the default trigger. But, occasionally, we might want to add an exception to the general rule. For example, you might want the trigger to apply to all guilds except clerics. In that case, we create a second trigger with the same name, whose response is

    bury corpse

When the current character is a cleric, the second trigger will be the active one, because guild profiles take priority over world profiles. For everyone else, there will be only one mytrigger available - the one belonging to the world - and that will be the active one.

5.6 Changing priorities

If, for some reason, you'd prefer guilds to take priority over races, it's possible to change the priority order - but you shouldn't do it unless you really need to. See the help for the following client command:

    ;help setprofilepriority
    ;h spp

    ;help listprofilepriority
    ;h lpp

Previous Index Next