I've seen a number of requests from people who want to write scripts to optimize their outfits for Moxie, select equipment to maximize Spell Damage, or do various other things that need to look at the enchantments on equipment. (I've also seen people request that the Gear Changer show them things like that so they can work out their outfits in the GUI. But, that's a UI project, and thus falls into holatuwol's area of expertise; it will happen if and only if he finds it interesting someday. This is the KoLmafia scripting community, and I have a solution for scripts.)
You'll be happy to learn that with revisions 4461 and 4472, ASH provides access to a whole slew of modifiers.
- I programmatically parsed the Item Description page for every single item (2800+) and mined everything I could from it. I used that data to correct numerous errors in KoLmafia's internal database. KoLmafia now stores up to 41 numeric parameters and 2 strings for any given item, effect, or skill.
- You can access the modifiers by name. Here are the names for the numeric parameters:
"Cold Damage"
"Cold Resistance"
"Cold Spell Damage"
"Combat Rate"
"Critical"
"Damage Absorption"
"Damage Reduction"
"Experience"
"Familiar Weight"
"Fumble"
"Hot Damage"
"Hot Resistance"
"Hot Spell Damage"
"Initiative"
"Item Drop"
"Mana Cost"
"Maximum HP Percent"
"Maximum HP"
"Maximum MP Percent"
"Maximum MP"
"Meat Drop"
"Melee Damage"
"Monster Level"
"Moxie Percent"
"Moxie"
"Muscle Percent"
"Muscle"
"Mysticality Percent"
"Mysticality"
"Ranged Damage"
"Sleaze Damage"
"Sleaze Resistance"
"Sleaze Spell Damage"
"Spell Damage Percent"
"Spell Damage"
"Spooky Damage"
"Spooky Resistance"
"Spooky Spell Damage"
"Stench Damage"
"Stench Resistance"
"Stench Spell Damage"
Those apply to items, effects, skills, and your character as whole, taking worn items, active effects, and passive skills into account.
Items also have two potential string parameters:
"Class"
"Intrinsic Effect"
You can access these parameters from ASH using the following functions:
float numeric_modifier( string );
float numeric_modifier( item, string );
float numeric_modifier( effect, string );
float numeric_modifier( skill, string );
string string_modifier( item, string );
and you can convert the returned string of "Class" using:
class to_class( string );
I attach a little ASH program that demonstrates this feature.
I'll be tweaking this from now until the next version of KoLmafia is released. I'll add the modifiers for a bunch of effects, for example, and I know of a couple tricky things that need some work. But, if you wish to play with this before the next release and have any comments or suggestions, feel free. Just remember all the usual caveats regarding using Daily Builds.
You'll be happy to learn that with revisions 4461 and 4472, ASH provides access to a whole slew of modifiers.
- I programmatically parsed the Item Description page for every single item (2800+) and mined everything I could from it. I used that data to correct numerous errors in KoLmafia's internal database. KoLmafia now stores up to 41 numeric parameters and 2 strings for any given item, effect, or skill.
- You can access the modifiers by name. Here are the names for the numeric parameters:
"Cold Damage"
"Cold Resistance"
"Cold Spell Damage"
"Combat Rate"
"Critical"
"Damage Absorption"
"Damage Reduction"
"Experience"
"Familiar Weight"
"Fumble"
"Hot Damage"
"Hot Resistance"
"Hot Spell Damage"
"Initiative"
"Item Drop"
"Mana Cost"
"Maximum HP Percent"
"Maximum HP"
"Maximum MP Percent"
"Maximum MP"
"Meat Drop"
"Melee Damage"
"Monster Level"
"Moxie Percent"
"Moxie"
"Muscle Percent"
"Muscle"
"Mysticality Percent"
"Mysticality"
"Ranged Damage"
"Sleaze Damage"
"Sleaze Resistance"
"Sleaze Spell Damage"
"Spell Damage Percent"
"Spell Damage"
"Spooky Damage"
"Spooky Resistance"
"Spooky Spell Damage"
"Stench Damage"
"Stench Resistance"
"Stench Spell Damage"
Those apply to items, effects, skills, and your character as whole, taking worn items, active effects, and passive skills into account.
Items also have two potential string parameters:
"Class"
"Intrinsic Effect"
You can access these parameters from ASH using the following functions:
float numeric_modifier( string );
float numeric_modifier( item, string );
float numeric_modifier( effect, string );
float numeric_modifier( skill, string );
string string_modifier( item, string );
and you can convert the returned string of "Class" using:
class to_class( string );
I attach a little ASH program that demonstrates this feature.
I'll be tweaking this from now until the next version of KoLmafia is released. I'll add the modifiers for a bunch of effects, for example, and I know of a couple tricky things that need some work. But, if you wish to play with this before the next release and have any comments or suggestions, feel free. Just remember all the usual caveats regarding using Daily Builds.