Maximize.ash, maximize equipment in one command.

Status
Not open for further replies.
a quick search of modifiers.txt (kolmafia's internal data) only shows...
Code:
V for Vivala mask	Single Equip, Muscle Percent: +30, Critical: 1, Softcore Only
on the wiki it shows the mask only gives experience on a critical hit (not having the mask im not sure how it works)
if you wanted to force the script to consider the mask you could add the following line to the opening of getModValue (for items)...
Code:
int getModValue(item i, string attrib) {
	if(i == $item[V for Vivala mask] && attrib == "Experience") { return 1; }
	if(i == $item[scratch 'n' sniff sword] || i == $item[scratch 'n' sniff crossbow]) {
 
Appears to not handle the hobopolis items labelled (Bonus for Saucerors only) etc for other classes.
I dont think i have any class specific items but ive tried to make a work around... replacing getTrimmedList with the bellow code should work
Code:
boolean getTrimmedList(string attrib) {
	if (count(itemMapTrimmed) > 0) { clear(itemMapTrimmed); }
	
	foreach i in outfit_list {
		int rate = getModValue(outfit_list[i].outfit, attrib);
		if (rate > 0) {
			outfitMapTrimmed[ to_lower_case(outfit_list[i].outfit) ] = rate;
		}
	}

	
	file_to_map(equipmentDataFile + "_" + attrib + extensionDataFile, itemMapTrimmed);
	if (count(itemMapTrimmed) == 0) {
		print("Unable to load specific attribute list, attempting to generate it", "red");
		makeTrimmedList(attrib);
		if (count(itemMapTrimmed) == 0) { abort("Invalid attribute '" + attrib + "' (or error loading both files)"); }
	}
	if (WearShirts == false) { remove itemMapTrimmed[$slot[shirt]]; }
	
	int itemPre = 0;
	int itemCount = 0;
	string own_class = to_string(my_class());
	foreach slot in itemMapTrimmed {
		itemPre = itemPre + count(itemMapTrimmed[slot]);
		foreach i in itemMapTrimmed[slot] {
			string class_limit = string_modifier(to_string(i), "Class");
			if (can_equip(i) && (class_limit == "" || class_limit == own_class) && available_amount(i) > 0 ) {
				itemMapTrimmed[slot, i] = getModValue(i, attrib);
			} else {
				remove itemMapTrimmed[slot, i];
			}
		}
		itemCount = itemCount + count(itemMapTrimmed[slot]);
		if (count(itemMapTrimmed[slot]) == 0) {
			remove itemMapTrimmed[slot];
		}
	}
	print("You only have " + itemCount + " of the possible " + itemPre + " item(s) which have this modifier");
	return true;
}
also, as I'm not in hardcore I havnt managed to test if Softcore Only items return false on can_equip(item)... is anyone having any problems with a hardcore character trying to equip Softcore Only items?
 
also, as I'm not in hardcore I havnt managed to test if Softcore Only items return false on can_equip(item)...
Currently, can_equip() doesn't check the Softcore Only flag. This is clearly a bug (although one affecting few players, since the only way to even have such an item in hardcore is to have bought it from Mr. Store during the current run), and has been fixed in r6963.
 
So, this script is super-useful and I am very grateful for the efforts that have gone into recent development/maintenance.

Would someone be willing to post a zip file of the entire installation, with all the most up-to-date files (together with any files that have not changed)?


-TH3Y thank you
 
added Spooky Putty support, now you can (if you choose) let the script squash your spooky putty into the best equipment for your needs, it should also be capable of supporting multiples spooky puttys but i cant test that... specifying -putty[sheet] will make sure atleast one of your puttys is a sheet (and is ignored on characters without any puttys so bounty hunter scripts dont need to check for a putty item before calling equipt.ash)
if you want putty changing to be default change the 'usePutty' variable to true

also added a new option '-help' which will list all the script's options and give a couple of basic examples...

Would someone be willing to post a zip file of the entire installation, with all the most up-to-date files (together with any files that have not changed)?
using this script you dont need to download any other files, once you have placed the script in your scripts directory you can 'call equipt.ash -regen' and it will generate the ItemMap data files it uses, but if you dont generate the ItemMaps the script will happily generate them as you need them

I'm not sure if ive mentioned this by kolmafia's numeric_modifier (and thus the equipt.ash script) are case sensitive, 'Adventures' is not the same as 'adventures'

I've also added a version variable to the script, seen by 'call equipt.ash -help', to aid diagnosing any problems that might be from an old copy of the script

edit: Oops, -putty[sheet] wasnt (completely) ignored if you didnt have any putty items, uploaded new 1.1a
 

Attachments

Last edited:
using this script you dont need to download any other files, once you have placed the script in your scripts directory you can 'call equipt.ash -regen'

Thank you! I wasn't following closely and thought we were dealing with tweaks to sub-files from the maximize.ash suite. Now I understand: equipt.ash replaces all of maximize.ash and its 'maximize' folder.


One suggestion: have a help-style option that would print a list of all acceptable modifier names... [EDIT: Never mind - 'modref' does this in the CLI, not needed in the script itself]


And one glitch: If a call to equipt.ash finds a particular accessory, which you already have equipped but in a different slot than equipt.ash wants to place, the result can be that you end up with fewer accessories equipped than you started with.

Concrete example:
- acc1=breath spray, acc2=shiny ring, acc3=dirty hobo gloves.
- call equipt.ash Muscle
[equipt.ash finds only one applicable accessory: shiny ring, which it wants to place in acc1]
- result: acc1=shiny ring, acc2=empty, acc3= dirty hobo gloves. However, desired behavior might be to have all 3 of the status quo ante accessories equipped, rather than "losing" one of them.


-Th3Y thank you...
 
Last edited:
Weird bug

[note: the behavior below is with maximize.ash -- I haven't messed with equipt.ash much yet, I haven't tweaked it to handle Hodgman gear yet]

Ok, I have some Hodgman gear and a hamster, so I've edited the data files to set my "farm" value on the hamster and the hodgman gear so they are chosen when appropriate (pretty much always ;). It was working just fine when I had Hodgman's Porkpie Hat and Hodgman's Lobsterskin Pants and it would equip 3 natty blue ascots as my accessories.

I zapped the pants into Hodgman's Bow-tie and Maximize now chooses to use my stainless steel slacks for pants (correct), equips the bowtie (correct) in slot 1, then equips a natty blue ascot in slot 2. That's all fine. But for some reason, it now wants to put Baron von Ratsworth's Monocle as the third accessory instead of using another one of my natty blue ascots (I still have three of them).


[EDIT:] I just fixed equipt.ash for me by making "getModValue" factor in hobo power (and adjusted the effect of item drop on the "Farm" value since we want to favor meat)

if (attrib == "farm")
return (
numeric_modifier(s, "Meat Drop") +
(numeric_modifier(s, "Item Drop") / 2) +
(numeric_modifier(s, "Hobo Power") * 1.5)
);

Also added this to force it to equip my hamster when farming (kind of brute force, but I'm pretty sure that in most cases if you have a hamster you want to be using it to farm):

if(i == $item[Hodgman's Imaginary Hamster] && attrib == "Farm") { return 75; }
 
Last edited:
I have been using equipt.ash for some time now and loving it.

One issue: it doesn't recognize annoying pitchfork as Monster Level equipment. I didn't check other familiar equipment.
 
I have been using equipt.ash for some time now and loving it.

One issue: it doesn't recognize annoying pitchfork as Monster Level equipment. I didn't check other familiar equipment.
Same remark but then for Meat Drops.
I have a Lucky Tam available but when I specify a Familiar, it equips the standard familiar equipment, in my case an Attention spanner since I use an Attention Deficit Demon.
 
equipt.ash version 1.2

adds handling of familiar items when picking or specifying a familiar, you can now use -item[] on familiar items (it doesnt check that the chosen familiar can equip the item so familiar specific equipment for a different familiar will likely cause problems)

I am posting a request on the bug tracker to add my familair's numeric_modifier so, hopefully, the script will start picking normal familiars based on their abilities
 

Attachments

I don't think your script will prevent trying to equip a melee weapon when with a ranged one. It tried to equip an octopus's spade in my offhand when I had a bottle-rocket crossbow already equipped. It doesn't see items equipped on my disembodied hand as well, I assume the hatrack is the same.

You should also consider making a new thread for your script, Maximize is pretty much dead and it would be a lot easier to keep the most up to date version of the script in the opening post as opposed to somewhere deep into this thread.
 
Last edited:
Edit: Oops, my bad, not a bug.

Great script, I've been using it extensively this run and it worked perfect, including familiar and sticker use.
 
Is anyone getting this error message (happened after I updated my build to 7188

> call scripts/equipt.ash

Expected ), found = (equipt.ash, line 616)

Also, I noticed that when you maximize "Adventures" it does not equip a time sword
in the offhand.
 
dangerpin, do you know how to get map_to_file or file_to_map to put all of the data
files into the "data" directory rather than the "scripts" directory. Right now
all of the generated data files are being put in my scripts directory.

I tried modifying the following line:

string equipmentDataFile = "data/ItemMap";
or
string equipmentDataFile = "/data/ItemMap";

But then I get filenames in the "scripts" directory called for example:

ItemMap_Adventures.txt
 
Last edited:
First off, lets establish that I am the basest of hacks. Not in the hacker sense, but in the golfing sense. I can barely cobble together scripts from bits and pieces that others (with actual skill) have written. That said...

Leaving it at the default
Code:
string equipmentDataFile = "data\\ItemMaps\\ItemMap";
creates a data directory in the folder the file is launched from called data where it will create the itemmaps directory of which you speak.

A possible workaround would be to put the script itself into your true data folder and then call the script from there either by using the GUI, scripts, load script method or from the CLI by using "call C:\Path2mafia\more\whathaveu\data\itemflags.txt" and leaving the default string above in place.

I haven't tested that it will create it properly, but I do suppose it will. There is another possible workaround that I will test and get back to you.
 
First off, lets establish that I am the basest of hacks. Not in the hacker sense, but in the golfing sense. I can barely cobble together scripts from bits and pieces that others (with actual skill) have written. That said...

Leaving it at the default
Code:
string equipmentDataFile = "data\\ItemMaps\\ItemMap";
creates a data directory in the folder the file is launched from called data where it will create the itemmaps directory of which you speak.

A possible workaround would be to put the script itself into your true data folder and then call the script from there either by using the GUI, scripts, load script method or from the CLI by using "call C:\Path2mafia\more\whathaveu\data\itemflags.txt" and leaving the default string above in place.

I haven't tested that it will create it properly, but I do suppose it will. There is another possible workaround that I will test and get back to you.

Hmm... this reverse slash stuff you are using doesn't really work on my mac.
Because the data directory was never created.

However, one workaround that I found was that I ran equipt -regen.. I moved
all of the generated files to the data directory and now when I run equipt -regen
again, they are recreated in the data directory... so for some reason once they
are found in the data directory they remain there.
 
Status
Not open for further replies.
Back
Top