KoLmafia Properties

From Kolmafia
Revision as of 08:14, 19 February 2009 by imported>Zarqon
Jump to navigation Jump to search

Part 11 - KoLmafia Properties

In addition to affecting gameplay directly through ASH functions and CLI commands, scripters also have the ability to control certain core behaviors of KoLmafia through direct modification of the preferences file. In addition, scripters can also create variables that will survive across sessions.

To see all of the pre-defined variables that exist, look in the “settings” subfolder wherever you keep the KoLmafia executable and open up any of the prefs_<character name>.txt and GLOBAL_prefs.txt files named for your characters. This guide will not attempt to describe all of the variables that are there: many are uninteresting from the player’s point of view and others are too unwieldy to be properly set at the moment. Of those that are interesting and accessable, the functionality can be divided into three main sections:

Choice Adventures

There is a large and ever-growing number of settings for choice adventures, all with the name choiceAdventureX (X is the number of the adventure). These settings control all of the non-combat adventures that give you a choice of outcomes. In the GUI, you can view and set these options in the Choices tab of the Preferences window, but you can also read and write the values from ASH using get_property() and set_property().

Each choiceAdventure is set to a number, which corresponds to which choice you want to make from the available options in KoL (or in the GUI, in the case that mafia provides more options than KoL). According to Holatuwol (here), the settings map to "X=pick the Xth Option" and "X+1=pick an item you don't have" (i.e., complete the outfit).

For a complete (and very useful) list of choice adventures, consult this page of the KoL Wiki.

Optionally, you can figure out the correct numeric value by logging in to KoLmafia, using the Preferences Window to set the value to what you want, exiting KoLmafia, and then checking your character’s settings file (yourname_prefs.txt) to see the value that was set for the appropriate key.

Other KoLmafia-based preferences

This is going to be a limited survey of the more interesting of the settings that you can control.

battleAction - This specifies the strategy that you will use in battle. The sorts of values that you might select here are “attack” for normal attacking, “custom” to use the Custom Combat Scripts, “item dictionary” when you’re adventuring in the Valley beyond Orc Chasm, or “skill thrust smack” to use TS during the entire battle.

hpAutoRecovery - This is a float value that specifies the percentage of your HP at which the autohealer kicks in. I haven’t tried it, but I think you’d be generally unhappy if you set it to something other than a multiple of 0.1.

hpAutoRecoveryTarget - A companion to the above, this is the target that the autohealer will aspire to achieve.

As before, feel free to peruse the .kcs file to see all of the values. The names aren’t very subtle, so you should be able to guess what they’re all for.

User-defined variables

In addition to setting the variables that KoLmafia predefines, you can also create any others to cover any information you wish. As you do so, keep in mind that while you can clear a variable’s value to the null string, there is currently no way to delete a key (aside from editing the .txt file in the text processor of your choice and deleting the line that contains the key).