13.14 AUTOMATIC DEFENSES

The Automatic Defense system (or Serverside Defenses, SSD, AutoDef) automatically raises and maintains defenses for you, similar to the auto-curing system. But while there's a fair amount you can configure about how auto-curing works, curing is mostly the same for everyone. Defenses, however, depend on a lot of personal choices: your skills, your resources, and what you're expecting to be doing. So setting up the AutoDef system takes a bit more thought.

======================================================================
THE DEFAULT PROFILE

We'll talk more about profiles a bit later, but for now we'll be setting up the profile named "default" that everyone has, which has the basic set of defenses you almost always want to raise. Things like nightsight, mercy, and waterwalk are commonly part of this profile.

If this is your first time working with the AutoDef system, your default profile has nothing in it, yet. So to get started, we'll do these things, which we'll cover in the next sections.

* Look up some defenses
* Add them to your default profile
* Review the profile we ended up with
* Tell the auto-deffer to raise everything

======================================================================
LOOKING UP DEFENSES

In many cases the defenses have names you'll consider obvious, like the ones I named before: NIGHTSIGHT, MERCY, and WATERWALK. Sometimes though the name won't be what you'd guess. For instance, when you CAST LEVITATE the defense is named LEVITATION, not LEVITATE. And sometimes when there's more than one way to the same defense, the name might be even more unexpected; consider GROUNDED, which can be gotten from Red in Lowmagic or Malkuth in Highmagic.

DEFS LIST ALL <searchtext> is how you find a defense if you're not sure what it's named. You can also look at DEFS LIST to see a full list of what's currently available to you. Once you find the one you want, you can click on it, or type DEFS INFO <defense>, to see more information about it. Here's what you'll see:

* A summary of the defense and what it does
* Whether or not you currently have it raised
* How it's raised; in many cases, there may be multiple paths,
  via skills, artifacts, wonder items, and other options
* The lines for when it's raised, when it fades, and in DEF
* How long it lasts and what strips it

Finally, you'll see a line like this:

  Profile 'default': off. Set to: [keepup] [defup]

This tells you that you currently have the 'default' profile selected, and in that profile, this defense is set to "off" - meaning it isn't being raised.

In some cases, you'll see more information about options to be set, as well, which we'll discuss a bit later.

----------------------------------------------------------------------
ADDING A DEFENSE TO A PROFILE

If you're looking at the DEFS INFO display, the easy way to add it to your current profile is to click either [keepup] or [defup] if you have MXP enabled (HELP MXP). Alternately, you can use a command:

> AUTODEF SET <defense> DEFUP|KEEPUP|OFF

You can also use SSD, which stands for Server-Side Defenses, as a synonym for AUTODEF throughout.

You can also specify many defenses at once:

> AUTODEF SET nightsight, metawake, insomnia KEEPUP

----------------------------------------------------------------------
KEEPUP VERSUS DEFUP

So what's all this about KEEPUP and DEFUP? Simple: DEFUP tells the auto-deffer to raise the defense once, and that's it; KEEPUP means to keep re-raising it every time it's stripped or fades. Which to use? Well, ask yourself this: if something or someone strips a defense, do you want the system to automatically raise it? What if it costs power, or uses up a consumable like a potion? What if takes balance, and that might interrupt you in the middle of something important? Maybe you'd rather do it manually, so you can be sure you still want to, and decide when is the right moment.

Note, though, that doing keepup in general is only active if you activate it, and if you've just started with AutoDef, it's probably still turned off. Do AUTODEF KEEPUP ON now, and see below for how to turn it on and off at will.

----------------------------------------------------------------------
SETTING DEFENSE OPTIONS

Sometimes a defense will have options you can, or even must, set. For instance, consider DEFS INFO ORIGAMICHARM. A single defense covers both wetfold and kirigami, since they are mutually exclusive. So in addition to telling the AutoDef system you want to raise it, you also have to tell it which origami you want. (Though if you only have one type in stock, it'll default to that one.) To choose wetfold, you'd do:

> AUTODEF SET origamicharm DEFUP
> AUTODEF SET origamicharm VERSION=wetfold

While VERSION is the most common option, some defenses may have other options as well. For instance, PRIORITY helps you determine which defenses to raise sooner (lower numbers), useful for defenses that require health, mana, ego, or power to be at certain levels. DEFS INFO <defense> may explain other options as available.

======================================================================
DEFFING UP

Once your profile is created, simply type DEFUP and the auto-deffer will get right to work, raising any defenses that aren't already raised. You'll want to do this after you log in, and after you come back from any unfortunate deaths you suffer. Everything set to DEFUP will be raised; everything set to KEEPUP will not only be raised, but then raised again whenever it fades or is stripped.

You can pause and resume this automatic reraising of all defenses or only some. For instance, maybe you're about to teleport and don't want to be interrupted.

> AUTODEF KEEPUP ON|OFF        - Turn all KEEPUP on and off
> AUTODEF PAUSE                - Pause all KEEPUP reraising
> AUTODEF PAUSE <def>, <def>   - Pause just those specified
> AUTODEF RESUME               - Resume all KEEPUP reraising
> AUTODEF RESUME <def>, <def>  - Resume just those specified

Also note that keepup is only active when Autocuring is active.

You can also raise a specific defense, or several, without adding it to your profile, with AUTODEF NOW <defense>,<defense>. Good for when you need to do something on the fly for a one-off situation, or to manually reraise something that you set to DEFUP instead of KEEPUP.

The auto-deffer will be smart about how to raise defenses in a few key ways you should know about:

* If there's multiple ways to raise a defense, for instance, a skill
  and an artifact, it automatically considers which ones you have
  available, and uses the least expensive. You can sometimes SET a
  VERSION to bypass these smarts and make it pick the one you want.

* If a defense is in the profile, but you can't currently raise it, 
  say because you ran out of the supply it uses, or due to a [<skillflex>]
  you don't have the skill, it will simply go on. So you can put in
  the defenses from all the skillsets and classes you use, and let it
  pick out the ones that apply to the configuration you're in.

======================================================================
USING PROFILES

So far we've talked about this like you only have one profile. And maybe you always do the same stuff. But maybe you don't. After all, some of your defenses are great for hunting and others for [<influence>] - and even within influencing, consider all those defenses specific to charity, or to paranoia. Maybe you hunt sometimes in places that aren't that dangerous, but in other places, you want to raise more (and more costly) defenses, because things are more challenging. Maybe in combat you want different profiles depending on whether you're trying to hold ground, do ranged offense, or be a front-line fighter. The AutoDef system supports profiles - you can have up to 50 - to help make these things possible.

First we'll talk about the basic methods of building new profiles and switching between them. Then we'll talk about a more powerful method in which profiles include one another.

----------------------------------------------------------------------
CREATING A PROFILE

To create a new profile, you just need to give it a name (made of letters, numbers, underscores, and dashes) and then type AUTODEF PROFILE CREATE <name>. This does not make it your current profile, it simply creates it.

Now you can use the same syntax as before to add defenses to it, and set options for them, but with an extra PROFILE <name> element to specify the profile you want to change:

> AUTODEF PROFILE <name> SET <defense> DEFUP|KEEPUP|OFF
> AUTODEF PROFILE <name> SET <defense> VERSION=<version>

You can use AUTODEF PROFILE <name> SHOW to look at the profile without switching to it.

----------------------------------------------------------------------
USING YOUR NEW PROFILE

Make your new profile the active one by typing AUTODEF PROFILE <name> (or AUTODEF SWITCH <name>). Then you might want to do another DEFUP to raise any defenses you need in the new profile that weren't already up.

What about defenses that you already have up from the previous profile that aren't in the new one? Often you want to leave them alone, but a few might be worth lowering, such as Charismatic Aura, due to its mana drain. For this, you can set the LOWERING option, which you can do for the whole profile, or on a defense-by-defense basis, with:

> AUTODEF PROFILE <profile> SET LOWERING=ALERT|QUIET|AUTO
> AUTODEF PROFILE <profile> SET <def>,<def>,<def> LOWERING=ALERT|QUIET|AUTO

QUIET means the auto-deffer does nothing; ALERT means it gives you a message; and AUTO means it will attempt to lower the defense if it has a means to do so. The default is ALERT. You can also use AUTODEF CONFIG to set a global default for all your profiles (see more about configuration below).

----------------------------------------------------------------------
MORE COMMANDS TO WORK WITH YOUR PROFILES

> AUTODEF PROFILES                           - list all your profiles
> AUTODEF PROFILE COPY <oldname> <newname>   - duplicate a profile
> AUTODEF PROFILE DELETE <name>              - delete a profile
> AUTODEF PROFILE RENAME <oldname> <newname> - rename a profile

======================================================================
PROFILES INCLUDING OTHER PROFILES

Consider this scenario: you've made a default profile, then you've copied it and added a bunch of defenses to make a hunting profile, and then another copy for charity, and then another copy for combat, and so on. And then you just got a shiny new artifact that gives you a neat new defense you want up all the time. Uh oh. Now you have to add it to every one of those profiles! That's not only a hassle, it's easy to forget to do it.

You can make the auto-deffer way more powerful, and avoid this, by using profile inclusion.

How does that work? Let's consider the scenario above. First you make a default profile. Then you make a hunting profile that has everything in default, plus three other defenses. But instead of copying default and adding three things, you instead set the new profile to *include* the default profile, then add those three defenses to it:

> AUTODEF PROFILE CREATE hunting
> AUTODEF PROFILE hunting
> AUTODEF PROFILE INCLUDE default
> AUTODEF SET geburah, chaotesign, origamicharm DEFUP
> AUTODEF SET origamicharm VERSION=kirigami

Now the hunting profile includes everything in default, plus three more things, and when you DEFUP with it, you get everything raised. But - and this is where it gets spicy! - if you later got a new artifact and added a new defense to default, it'll automatically come along when you raise hunting, too.

You can even have multiple levels of inclusion (within reason!). For instance, you could have a hunting profile that includes your default profile plus a few hunting defenses, then an astral profile that includes your hunting profile plus a few more to help with astral insanity. You can have a Grimkeep profile that includes the hunting profile too, and then a second Grimkeep profile that adds even more, that you can fire up when the run gets more dangerous. You can build a base influence profile that has common things like Charismatic Aura, then specific profiles that add defenses specific to charity or weakening on top of those.

Don't go trying to make weird things like profileA including profileB which includes profileA. You don't want to know what happened to the last person who tried that.

----------------------------------------------------------------------
OVERRIDING INCLUDED PROFILES

Suppose you have a profile that you want to include in another profile, but it has one defense in it that you do *not* want in this second profile. For instance, maybe you have a baseline, inexpensive shielding defense in your more basic profile, but when you go into a more dangerous situation, you want to not raise that and instead raise a more expensive but more potent protection instead. No problem! Simply create the profile and have it include the other one as usual; then add the unwanted defense set to be turned OFF, like this:

> AUTODEF PROFILE CREATE scaryhunting
> AUTODEF PROFILE scaryhunting
> AUTODEF PROFILE INCLUDE normalhunting
> AUTODEF SET weakshield OFF
> AUTODEF SET strongshield DEFUP

Now when you raise the scaryhunting profile, the weakshield defense won't get raised, even though it's part of the normalhunting profile.

You can also set options like VERSION on the new profile, and those also override any options set on the included profile.

In addition, just as you can use INCLUDE to include a profile, you could use EXCLUDE to exclude it; everything in the excluded profile is assumed to be OFF, unless explicitly set as KEEPUP or DEFUP in the new profile.

----------------------------------------------------------------------
IMPORTING AND EXPORTING PROFILES

You can export a profile into a command that can be used to recreate the profile. This is handy if you want to play with your profiles in some other editor before rebuilding them, or when you want to share your defense profiles with a friend (or another character of your own!).

> AUTODEF PROFILE EXPORT <name> [FLAT]

The FLAT option controls whether included profiles are listed as they are, or are replaced with their contents. The latter may be more useful if you want to show this to someone else, who might not have, or want, the same sets of profiles including other profiles, that you have. For instance, without the FLAT option you might see:

  AUTODEF PROFILE IMPORT hunting ~default keepup=geburah,origamicharm,
  chaotesign origamicharm:version=kirigami

If someone else tried to use this and didn't have a profile named default, it wouldn't work! Or if they did, but it had different things in it than yours, the results might be unexpected. Using FLAT, you might see:

  AUTODEF PROFILE IMPORT hunting keepup=waterbreathe,levitation,
  waterwalk,geburah,origamicharm,chaotesign origamicharm:version=kirigami

This version doesn't have the benefits of including profiles described above, but it'll work for anyone.

======================================================================
CONFIGURATION

Use the AUTODEF CONFIG command to see and set configuration options you can do to control how the auto-deffer works. For instance, you can set CONTAINERS to identify the item numbers of any containers, like a backpack or purse, where you store things a defense might use (like origami).


======================================================================
CREDITS

The initial version of this helpfile was authored primarily by Tuilinn.

Thanks to all players who assisted in the testing and direction of this system. Of particular note, Tuilinn and Xenthos provided noteworthy feedback and extensive testing throughout the process.