Maximize.ash, maximize equipment in one command.

Status
Not open for further replies.
That appears to be working correctly for the new DG items. Many thanks!

I should've offered to loan you the items. Sorry you got scammed.

Update: Today the DG items give +0 adventures and are correctly not equipped. Looks like it's working right.
 
I'm just pasting this darn list in to the thread so I don't have to keep going to look for it. :) Thanks again for the awesome script.


"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"
 
He copied a very old list from July 27, 2007 here. Jason provided a much more recent list of all numeric modifiers to help me with my recovery script. Here it is:

"Familiar Weight", "Monster Level", "Combat Rate", "Initiative", "Experience", "Item Drop", "Meat Drop", "Damage Absorption", "Damage Reduction", "Cold Resistance", "Hot Resistance", "Sleaze Resistance", "Spooky Resistance", "Stench Resistance", "Mana Cost", "Moxie", "Moxie Percent", "Muscle", "Muscle Percent", "Mysticality", "Mysticality Percent", "Maximum HP", "Maximum HP Percent", "Maximum MP", "Maximum MP Percent", "Melee Damage", "Ranged Damage", "Spell Damage", "Spell Damage Percent", "Cold Damage", "Hot Damage", "Sleaze Damage", "Spooky Damage", "Stench Damage", "Cold Spell Damage", "Hot Spell Damage", "Sleaze Spell Damage", "Spooky Spell Damage", "Stench Spell Damage", "Critical", "Fumble", "HP Regen Min", "HP Regen Max", "MP Regen Min", "MP Regen Max", "Adventures", "Familiar Weight Percent", "Melee Damage Percent", "Ranged Damage Percent", "Stackable Mana Cost", "Hobo Power", "Base Resting HP", "Resting HP Percent", "Bonus Resting HP", "Base Resting MP", "Resting MP Percent", "Bonus Resting MP"

There are a few new ones like "Hobo Power", "Melee Damage Percent" and "Adventures". Interestingly I'm pretty sure that there is nothing in the game that gives "Maximum MP Percent" or "Maximum HP Percent", but it's nice to know that kolMafia is ready just in case such an effect ever appears.
 
[quote author=Bale link=topic=1410.msg10575#msg10575 date=1229769442]Interestingly I'm pretty sure that there is nothing in the game that gives "Maximum MP Percent" or "Maximum HP Percent"[/quote]
[quote author=Passive Skills section of modifiers.txt]Abs of Tin Maximum HP Percent: +10
Cosmic Ugnderstanding Maximum MP Percent: +5
Gnomish Hardigness Maximum HP Percent: +5
Marginally Insane Maximum MP Percent: +10[/quote]
Hang in there, a modref command is on the way.
 
modref would be quite nice since that is such a hidden part of kolMafia's mechanics. Wisdom of the Elder Tortoises and Spirit of Ravioli are also set up like that, right?

I hadn't realized mafia categorized those skills that way since I was just thinking of them as part of the HP and MP formulas. Interesting.
 
[quote author=Bale link=topic=1410.msg10596#msg10596 date=1229815967]Wisdom of the Elder Tortoises and Spirit of Ravioli are also set up like that, right?[/quote]
Um, no - that was the complete list. Looks like modref turned up its first bug 10 minutes before being submitted!

Mafia currently doesn't actually do anything with those particular modifiers, it just uses the max HP/MP values from the side pane. Ideally, it would be able to accurately calculate those values on its own, so it would be able to tell when an equipment/outfit change is going to result in a loss of HP or MP, and take appropriate action.
 
[quote author=jasonharper link=topic=1410.msg10598#msg10598 date=1229818020]
Um, no - that was the complete list. Looks like modref turned up its first bug 10 minutes before being submitted!

Mafia currently doesn't actually do anything with those particular modifiers, it just uses the max HP/MP values from the side pane. Ideally, it would be able to accurately calculate those values on its own, so it would be able to tell when an equipment/outfit change is going to result in a loss of HP or MP, and take appropriate action.
[/quote]

I see. I suspected that info wasn't actually used since the forumula for Max HP/MP isn't tidy. Unfortunately (according to the wiki) each of those modifiers is applied separately with a floor() or ceil() after each step. Some of those skills are floored and others ceilinged. The only apparently pattern is that the larger modifiers get a floor before applying the next modifier, but the smaller modifiers get a ceiling instead. It's a mess and doesn't allow a simple formula to account for all possibilities of Max HP/MP Percentage now and future. I'm rather unhappy with Jick's lack of elegant mathematics in that regard. Here's a snippet of code I'm using for the issue.

Code:
// What would maximum HP be if I wasn't beaten up? Or if I was in a different outfit?
// Need to send p as a parameter because of the different outfit possibility...
int find_maxhp(int mus, float p){
	float g = .05 * to_int(have_skill($skill[Gnomish Hardigness])) +1;
	float a = .1 * to_int(have_skill($skill[Abs of Tin])) +1;
	float r = .25 * to_int(have_skill($skill[Spirit of Ravioli])) +1;
	float c = .5 * to_int(my_primestat() == $stat[muscle]) +1;
	// float p = numeric_modifier("Maximum HP");
	return ceil(g* ceil(a* ceil(r* (floor((mus+3) *c) +p))));
}

// What would maximum MP be if I wasn't beaten up? Or if I was in a different outfit?
int find_maxmp(int mys, float p){
	float g = .05 * to_int(have_skill($skill[Cosmic Ugnderstanding])) +1;
	float m = .1 * to_int(have_skill($skill[Marginally Insane])) +1;
	float w = .5 * to_int(have_skill($skill[Wisdom of the Elder Tortoises])) +1;
	float c = .25 * to_int(my_primestat() == $stat[mysticality]) +1;
	// float p = numeric_modifier("Maximum MP");
	return ceil(g* ceil(m* floor(w* (floor(mys *c) +p))));
}

According to my outfit switching and unbeating tests, those numbers work. I'd probably have been off by a point plus or minus if it was done intelligently and maintained as a float until the final step.
 
This does not seem to recognize that the glow in the dark wristwatch does not stack with dead guys memento (and possibly other watches?)
 
It also does not seem to be recognizing the depleted grimacite items. I've tried updating a couple times, but it always returns the same things, even if I remove the first line in the appropriate data files:

> call maximize.ash update

0
One of more required data files not found. Creating them now.
1337 7r0uZ0RZ
Radio Free Baseball Cap
Radio Free Foil
Radio Free Pants
cement shoes
draggin' ball hat
fire
leather chaps
makeshift turban
mesh cap
metallic foil cat ears
navel ring of navel gazing
origami riding crop
toy jet pack
wolf mask
Required files created.
Finding best outfit for update
Equipping:
__________
Hat: time helmet(0)
Shirt: none(0)
Pants: time trousers(0)
Weapon: time sword(0)
OffHand: Hodgman's metal detector(0)
Acc1: dead guy's memento(0)
Acc2: glow-in-the-dark wristwatch(0)
Acc3: tiny plastic Crimbo reindeer(0)
Mod:
__________
Best outfit for update Equipped.
Done.
 
Is this script broken for anyone else? It was workign before, but now it always says the best outfit is equipped...
 
I just used it this morning on the latest daily and it worked like a charm.

Can you give more information? What does your GCLI output look like?
 
Is this script broken for anyone else? It was workign before, but now it always says the best outfit is equipped...

The reason I ask is that usually, when it just says the best outfit is equipped it means there is a problem with, or a typo in, the modifier you are choosing. I get this when I accidentally type....

"call maximize.ash cold resistence" instead of...

"call maximize.ash cold resistance"
 
Hi
I've remade (most of) the script, you can now specify a list of attributes you want...
such as... call equipt.ash -fill[Item Drop] -fill[Moxie] Meat Drop
will fill up your outfit with your best equipment for Meat Drop, then fill any gaps with your best for Item Drop, then finally fill with your best for Moxie

it also handles special stuff like your sticker weapons, watches and handles your Disembodied Hand...
hopefully once I've tested my java code a bit more the script will also be able to handle all familiars

the script's options...
-regen remakes all the ItemMap data (the small lists of equipment specific to an attribute)

-stickers[] can be set to 'save' or 'off' to avoid using any stickers, or set to a number which only selects a stickers if you have more than that number in your inventory

-familiar[] 'current' or 'none' will specify not to choose a familiar (but wont remove one), or you can specify a familiar type to use

-item[] specify an item you need in the outfit, you can have more than one of these

-fill[] specify what to put in the empty spaces, you can have more than one of these

-outfit[] specify a specific outfit to use, adds the outfits items just like specifying -item[] for each of them

-sim just prints out the best outfit but doesn't put it on

I believe the script will make the scripts\data\ItemMap directory itself
but you need to make a scripts\rawdata directory and add..
familiars.txt
outfits.txt
and equipment.txt (renamed to equipment.txt.ash because of forum file limits on .txt, just change the name back)
these are all files from the SVN so you should be able to update those files, call equipt.ash -regen ... then be using the latest data


edit: -- these files are no longer the latest, see the post bellow
 

Attachments

Last edited:
I used your script today and it generated the itemmap correctly.
Then I called to script with these parameters "call equipt.ash -fill[Item Drop]" and it gave me an error message and generated the following debug log:
oh yeah, I'm using the latest daily build.
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
            KoLmafia r6957, Windows XP, Java 1.6.0_10
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post these logs in the KoLmafia thread.  If 
 you would like us to look at the log, please instead email logs 
 to veracity@hambo.com using the subject "KoLmafia Debug Log" 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Sun Feb 15 21:39:34 CET 2009
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.StringIndexOutOfBoundsException: String index out of range: 1
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
	at java.lang.String.substring(Unknown Source)
	at net.sourceforge.kolmafia.textui.RuntimeLibrary.substring(RuntimeLibarary.java:2599)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.execute(LibraryFunction.java:119)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:157)
	at net.sourceforge.kolmafia.textui.parsetree.Operator.applyTo(Operator.java:139)
	at net.sourceforge.kolmafia.textui.parsetree.Expression.execute(Expression.java:111)
	at net.sourceforge.kolmafia.textui.parsetree.WhileLoop.execute(WhileLoop.java:73)
	at net.sourceforge.kolmafia.textui.parsetree.Scope.execute(Scope.java:397)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:125)
	at net.sourceforge.kolmafia.textui.Interpreter.executeScope(Interpreter.java:240)
	at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:185)
	at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:178)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeScriptCommand(KoLmafiaCLI.java:4370)
	at net.sourceforge.kolmafia.KoLmafiaCLI.access$300(KoLmafiaCLI.java:140)
	at net.sourceforge.kolmafia.KoLmafiaCLI$Call.run(KoLmafiaCLI.java:2186)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:551)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:445)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:317)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:298)
 
I called to script with these parameters "call equipt.ash -fill[Item Drop]" and it gave me an error message
I think thats because the script is expecting an 'unquoted' attribute at the end
"call equipt.ash Item Drop" would work and ...
"call equipt.ash -fill[Moxie] Item Drop" would search for Item Drop then fill the gaps with Moxie
in both the last attribute isnt contained in -fill[] and is handled first, seams kind of stupid now I think about it, I'll see about fixing the code to not force an unquoted attribute (but leave support for it as its how Maximize.ash worked)

edit: added quick fix...
you shouldnt need to have an unquoted attribute anymore, also removed the need for rawdata directory (and files) now using internal kolmafia files... so now all you need is the one file and it should generate all the other files it needs
 

Attachments

Last edited:
I didn't use the quotes when I inputted it in the cli window. :)
Sorry if I wasn't clear about that.
I will try with your suggestion though.
 
Status
Not open for further replies.
Back
Top