Equipt - an item selection tool

DerDrongo

Member
Equipt.ash [version: 1.8] [released: 10/06/09]
Equipt can help you select the best outfit and familiar for your needs, using internal kolmafia files this script should not need to be updated everytime a new item/familiar is released, just wait for kolmafia to support them (you can even help the devs to make the wait shorter) then regenerate the item maps and the script should be ready to use the new items
the original script was created by Paragon and can be found here

Usage:
download the latest version here and rename the file to equipt.ash, then...
call equipt.ash -regenthis will generate all the item map files, you can move them from the kolmafia/scripts directory to kolmafia/data if you want to keep your scripts directory neat
call equipt.ash -fill[Moxie]this will fill your outfit with your best Moxie outfit
call equipt.ash -fill[Moxie] -fill[Muscle]... the same as above but this will fill any spaces in the outfit with Muscle items
call equipt.ash -fill[Moxie=20] -fill[Muscle]... this will try to make an outfit giving atleast 20 Moxie but using the least number of items, then fill the spaces with Muscle

Options:
-sim this stops the script from wearing or pulling any items
-regen generate new item map files adding any new items
-fill[] fill any gaps remaining with specified attribute, you can add multiple -fill[]s
-pull[]the maximum pulls the script will attempt, defaults to 0
-stickers[] 'off' stops sticker usage, any else is the minimum number of stickers needed to be selected
-familiar[] 'none' and 'current' stop a familiar being selected, anything else is considered the familiar type
-item[] adds the specified item to the outfit
-area[] adds the items needed to adventure is specified area, currently known: 'pirate', 'palindrome', 'mine', 'hobo', 'sewers' and 'sea'
-outfit[] adds the items of the specified outfit
-weaponlimit[] limit weapon choices to a specific type, you can add more than one to widen the search
-quiet stops printing output (default for script access)
-verbose prints out progress (default for CLI access)
-vverbose print out the outfits as it compares them
-strictLimits if a modifier limit can not be reach then the script fails (default for script access)
-softLimits continues even if modifier limit is not met (default for CLI)
-help prints out some help from the CLI you you dont have to search for this post
-libhelp prints out some help for importing this script into your own
-changelog prints out recent changes in this version

For a complete list of normal modifiers type: modref
Built in modifiers are: elemental damage, all (items that have all elemental resistances), Farm, HP Regen, MP Regen, -Monster Level, -Combat Rate and Air Supply

Common Issues
Item x is not being equipt ... have a look in the item map for the specific modifier you having a problem with, you should see the item with its value (at time of generating the item map, this value is only to aid debugging and is not used internally) if the item is missing or has a wrong value regenerate the item maps, if the item is still wrong/missing then kolmafia doesnt support this item or has the wrong info about it... if you think the item needs special handling in the script reply here

Item x is not being picked even though the -trace command shows it scoring higher ... reply here with the outfit it picked and the lines from the -trace command, just for the items picked and the one(s) you think it should have picked

Change Log
Version 1.8 (10/06/09)
Mainly a bug fixing version, familiar item selection and avoiding brimstone buckler with 2 handed weapons with a few minor changes to add more checks along the way

Also released is equipt_tester.ash ... its mainly for my own batch testing but should help with reporting problems, for example... if the script still had the brimstone buckler bug you could generate a pair of files to help, one containing your inventory/familiars the other containing the results from the script... all with a single command such as equipt_tester.ash trace item drop

Version 1.7 (26/05/09)
Support for area based modifiers, thanks again Jason ... now item behaviour based on location is used, this makes -regen take longer so i only told it to check all areas when I knew the modifier contains at least one area-dependant item
New internal modifier: Air Supply, which picks the best breathing equipment based on Stench Resistance
New areas are: sewers, hobo and sea (which adds Air Supply if you dont have a breathing effect)
Better pre-selected-familiar handling... When locked to a familiar (or specified) the script will still try and find the best familiar item

Version 1.6 (22/05/09)
KoL Mafia now supports a familiar numeric_modifier, thanks Jason ... now all familiars that Mafia supports, this script should as well :)
Improved brimstone handling... it should now check by adding one brimstone item at a time instead of checking all or nothing
Squashed another internal outfit error
 

Attachments

  • equipt--v1.6.ash
    80.3 KB · Views: 92
  • equipt--v1.7.ash
    94.7 KB · Views: 112
  • equipt--v1.8.ash
    99.3 KB · Views: 273
  • equipt_tester.ash
    7.2 KB · Views: 84
  • equipt_tests.txt
    566 bytes · Views: 93
Last edited:

Rinn

Developer
You can get the data files to automatically be placed in the data directly by using
Code:
string equipmentDataFile = "..\\Data\\ItemMaps\\ItemMaps";
It'd be nice if there was a ash function to return the working directory of mafia, the above only would work if equipt.ash is in the root scripts directory, if it was in a subfolder it wouldn't back up enough. I also think mafia doesn't know how to convert directory structures from pc to mac so there would have to be another function to get what system mafia is running on so we could correctly format the string.

Also the script tries to equip a chefstaff in your offhand, this can be fixed by adding another if check in the offhand foreach loop that loops through all the weapons at line 507
Code:
if (!contains_text(i.to_string(), "Staff of "))
I'm not sure if there's a better way to check if a weapon is a chefstaff, but only a chefstaff contains that string in its name currently.
 
Last edited:

Muhandes

Member
Trying to run this I get:

Bad item value: "flaming familiar doppelgהnger" (equipt.ash, line 135)

This is probably due to different locale or something like that. I replaced that odd letter with an "a" and while I can't say if it will use the item, it didn't fail.

Other than that I can say it indeed fixes the problem with Double-Fisted Skull Smashing with mixed types.

Thanks for the work, I find this script really useful (and awesome).
 

Rinn

Developer
Adventures isn't returning the optimal gear:

Code:
> Searching for Adventures
> [outfit: (none)] [hobo: (none)] [rate: 27]
> [outfit: Time Trappings] [hobo: (none)] [rate: 26]
> hat: time helmet
> shirt: General Sage's Lonely Diamonds Club Jacket
> pants: time trousers
> weapon: sword behind inappropriate prepositions
> offhand: (two handed weapon)
> acc1: dead guy's memento
> acc2: plexiglass pocketwatch
> acc3: stainless steel solitaire
> familiar: Disembodied Hand
> familiar item: time sword
>
The Time Trappings outfit should be returning a much higher rate. I have a second time sword so it's not a problem with it already being equipped on my familiar.
 

dangerpin

Member
Before we get too far into the new thread I just want to give thanks to DerDrongo for this great script. It has deserved a thread of its very own for a while and I'm just happy to have something that can take the place of Maximize and help me get the most out of my outfits.

Thanks!
 

DerDrongo

Member
The Time Trappings outfit should be returning a much higher rate. I have a second time sword so it's not a problem with it already being equipped on my familiar.
from the scores and output im guessing that the script only found 2 time swords, i will make a new -trace option tomorrow to list all item that provide a modifier and their available_amount and storage_amount values

Also the script tries to equip a chefstaff in your offhand
... and ...
Another bug: It tries to equip disembodied hand with chefstaves, specifically for elemental resistance.
What are the limits on the chefstaves? according to the wiki is shows you can only use one at a time but are you limited to where it can be? can you have it in your offhand if you have a non-chefstaff weapon? can the disembodied hand hold it?

... also noticed the script doesnt clear the disembodied hand if its not equipt, I must have lost that change in the hd breaking... i will re-add that tomorrow as well
 

Muhandes

Member
As Rinn said, A chefstaff can only be wielded in your main hand. It requires either the skill Spirit of Rigatoni or to be a Sauceror and be wearing a special sauce glove. In many cases if you are a Sauceror it is worth using the two slots and wielding a staff due to very high elemental resistance.
It cannot be wielded by a disembodied hand. ever.
 

DerDrongo

Member
Version 1.4 (View attachment 1478)
now understands chefstaves
stop Disembodied Hand from playing with swords in the terrarium
new option: -weaponlimit[] ... lets you limit the type of weapon to equipt, now you can -weaponlimit[club] -fill[Muscle] ... and are ready to club some seals!
more debugging...
new option: -vverbose ... lets you see the contents of all the outfits it considered
new option: -trace Modifier ... can be used to check how many items the script can see

@Rinn: can you do a -vverbose Adventures (and maybe a -trace Adventures and see if you can spot where the script is not picking optimal
 

Rinn

Developer
It decided to equip the outfit this time, but it may be because the depleted grimicite items only gave 1 adventure yesterday.

Code:
> Searching for Adventures
> Creating item map for: Adventures
> Searching for Adventures
> [outfit: (none)] [hobo: (none)] [rate: 29]
> hat: time helmet [score: 3]
> shirt: General Sage's Lonely Diamonds Club Jacket [score: 3]
> pants: time trousers [score: 3]
> weapon: time sword [score: 3]
> offhand: depleted Grimacite gravy boat [score: 3]
> acc1: dead guy's memento [score: 5]
> acc2: depleted Grimacite grappling hook [score: 3]
> acc3: depleted Grimacite weightlifting belt [score: 3]
> familiar: Disembodied Hand
> familiar item: time sword
>  
>  
> [outfit: Time Trappings] [hobo: (none)] [rate: 29]
> hat: (empty)
> shirt: General Sage's Lonely Diamonds Club Jacket [score: 3]
> pants: (empty)
> weapon: (empty)
> offhand: depleted Grimacite gravy boat [score: 3]
> acc1: dead guy's memento [score: 5]
> acc2: depleted Grimacite grappling hook [score: 3]
> acc3: depleted Grimacite weightlifting belt [score: 3]
> familiar: Disembodied Hand
> familiar item: time sword
>  
>  
> hat: time helmet [score: 3]
> shirt: General Sage's Lonely Diamonds Club Jacket [score: 3]
> pants: time trousers [score: 3]
> weapon: time sword [score: 3]
> offhand: depleted Grimacite gravy boat [score: 3]
> acc1: dead guy's memento [score: 5]
> acc2: depleted Grimacite grappling hook [score: 3]
> acc3: depleted Grimacite weightlifting belt [score: 3]
> familiar: Disembodied Hand
> familiar item: time sword
>  

familiar Disembodied Hand (30 lbs)

equip weapon time sword

equip off-hand depleted Grimacite gravy boat

equip acc1 dead guy's memento

equip acc2 depleted Grimacite grappling hook

equip acc3 depleted Grimacite weightlifting belt

equip weapon time sword

equip hat time helmet

equip pants time trousers

equip shirt General Sage's Lonely Diamonds Club Jacket
 > done.
Is it not taking the outfit bonus into account?
 
Last edited:

DerDrongo

Member
It decided to equip the outfit this time, but it may be because the depleted grimicite items only gave 1 adventure yesterday.
...
Is it not taking the outfit bonus into account?
it looks like the outfit bonus is being lost when it adds other items, that should be a simple fix, but also looks like when the outfits are being checked it loses some info, ill have a dig around and see how much is being lost
 

Bale

Minion
So... I just downloaded version 1.4 and renamed it to equipt.ash as the instructions dictate, then...
call equipt.ash -regen
Undefined reference to function 'fdsd_numeric_modifier' (equipt.ash, line 118)

Ooops! Guess I won't be using equipt until you fix that bug.
 

Bale

Minion
Thanks.

Great Googly-Moogly, that's a LOT of map files! I notice that the map files it created only contain the items that character possesses. Is there any problems with trying to use it for multiple characters? Does it re-create those map files every time?

Anyway, it seems to work very nicely. Thanks for the script.

A rather minor criticism: I notice that the commands are case sensitive. Ick. Could you make it parse moxie and Moxie equally? Similarly for other things that numeric_modifier handles? I don't mind having to watch my case in an ash script, but when I'm typing on the command line, I don't like to have to remember when to use the shift key. Not a big deal, it would just be a nice feature.
 

DerDrongo

Member
I notice that the map files it created only contain the items that character possesses. Is there any problems with trying to use it for multiple characters? Does it re-create those map files every time?
The map files generated should contain all items for that modifier, my Adventures item map lists General Sage's Lonely Diamonds Club Jacket despite me not having the jacket or the skill to equipt it...

A rather minor criticism: I notice that the commands are case sensitive. Ick. Could you make it parse moxie and Moxie equally? Similarly for other things that numeric_modifier handles? I don't mind having to watch my case in an ash script, but when I'm typing on the command line, I don't like to have to remember when to use the shift key. Not a big deal, it would just be a nice feature.
I will look into adding a function to change the case so kolmafia understands it
(are HP and MP the only exceptions to... capitals for first letter of each word with rest being lowercase?)
 

Bale

Minion
You're actually going to fix case? COOL!

(are HP and MP the only exceptions to... capitals for first letter of each word with rest being lowercase?)
Best to let KolMafia answer that for us:
Code:
[COLOR="Olive"]> modref[/COLOR]

Lots of stuff printed out... 
hmmm...
Yup. That seems to be the case.

DerDrongo said:
The map files generated should contain all items for that modifier, my Adventures item map lists General Sage's Lonely Diamonds Club Jacket despite me not having the jacket or the skill to equipt it...
Ah. Must have been my mistake then. Sorry about that.

Another minor suggestion: If it gets a bad option, instead of just saying "Failed to generate Item Map for 'help', is this the case correct?" [sic], it might be nice to also run the same code that it does for -help. After all, the person may need help, but not know how to get it.
 
Last edited:

dangerpin

Member
Yup. That seems to be the case.

I was actually wondering this myself, because when I created the item maps it had two of them in all lowercase. Those two are "all" and "elemental damage". I wondered if the naming of the item map files corresponded to a need for these to be in lowercase when calling the script.

Also, YAY for case insensitivity!
 

Bale

Minion
Found a bug:

Code:
[COLOR="olive"]> equipt Moxie -sim[/COLOR]

Searching for Moxie
Creating item map for: Moxie
[COLOR="Red"]Failed to generate Item Map for 'Moxie ', is this the case correct?[/COLOR]

Hmm? So I tried it without -sim and found a different bug.
Code:
[COLOR="olive"]> equipt Moxie[/COLOR]

Searching for Moxie
[outfit: (none)] [hobo: (none)] [rate: 884]
[outfit: Swashbuckling Getup] [hobo: (none)] [rate: 451]
[outfit: Star Garb] [hobo: (none)] [rate: 467]
[outfit: Glad Bag Glad Rags] [hobo: (none)] [rate: 259]
[outfit: Palmist Paraphernalia] [hobo: (none)] [rate: 266]
hat: Disco 'Fro Pick
shirt: grungy flannel shirt
pants: plexiglass pants
weapon: bottle-rocket crossbow
offhand: (empty)
acc1: Elvish sunglasses
acc2: dead guy's memento
acc3: tube sock
familiar: (empty)

Wielding bottle-rocket crossbow...
Equipment changed.
Putting on Elvish sunglasses...
Equipment changed.
Putting on dead guy's memento...
Equipment changed.
Putting on tube sock...
Equipment changed.
Putting on Disco 'Fro Pick...
Equipment changed.
Putting on plexiglass pants...
Equipment changed.
Putting on grungy flannel shirt...
Equipment changed.
[COLOR="Green"]done.[/COLOR]

At least the command worked if I wasn't simulating, but there is still a bug. Unfortunately that character has two bottle-rocket crossbows, so my off-hand shouldn't be empty.

Incidentally the same problem appears if I do this, but at least -sim works:
Code:
[COLOR="olive"]> equipt -fill[Moxie] -sim[/COLOR]

Searching for Moxie
[outfit: (none)] [hobo: (none)] [rate: 884]
[outfit: Swashbuckling Getup] [hobo: (none)] [rate: 451]
[outfit: Star Garb] [hobo: (none)] [rate: 467]
[outfit: Glad Bag Glad Rags] [hobo: (none)] [rate: 259]
[outfit: Palmist Paraphernalia] [hobo: (none)] [rate: 266]
hat: Disco 'Fro Pick
shirt: grungy flannel shirt
pants: plexiglass pants
weapon: bottle-rocket crossbow
offhand: (empty)
acc1: Elvish sunglasses
acc2: dead guy's memento
acc3: tube sock
familiar: (empty)

[COLOR="Blue"]Sim Complete.[/COLOR]
[COLOR="Green"]done.[/COLOR]
 
Top