Outfit Changer, a casual ascension aid

izchak

Member
Having done a few four day casual ascensions, I find a large amount of my time is spent changing outfits, especially now that +ML decreases the effectiveness of our noncombat increasers.
So, I wrote this little script to rapidly change my outfit based on my current need.
I initially tried to use a whole lot of custom outfits, but the problem with that, in a rapid ascension environment, is that stat requirements frequently make a custom outfit useless!

This script reads a tab separated file for 'outfit' info, I have attached the custom outfits file that I currently use.
When you call this script, it prompts for a 'bias' string. This bias is tied to the custom outfits file, each 'bias' has several items linked to it, in order of preference, by slot.
For instance, this is my Rollover outfit:
nightdress hat 0 time helmet
nightdress shirt 0 Corporal Fennel's Lonely Clubs Club Jacket
nightdress shirt 1 Corporal Fennel's Lonely Diamonds Club Jacket
nightdress weapon 0 plexiglass pike pike
nightdress weapon 1 time sword
nightdress offhand 0 time sword
nightdress pants 0 time trousers
nightdress acc1 0 filigreed hamethyst necklace
nightdress acc1 1 hamethyst necklace
nightdress acc1 2 plexiglass pocketwatch
nightdress acc1 3 imitation nice watch
nightdress acc1 4 stainless steel solitaire
nightdress acc1 5 dead guy's watch
The first column is the name of the 'bias', the second one is the slot, the third is the preference order (where 0 is most preferred), and the fourth column is the item.
As you can see, my preferred rollover outfit is biased more towards +pvp fights than +adventures. I <3 my pike pike!
Lets examine the 'weapons' slot first. When prompted to equip the 'nightdress' bias, this script will equip the plexiglass pike pike, if at all possible. If that fails, it will try to equip a time sword instead.
This brings me to the 'default' bias. This is exactly what you might think, the fallback bias. If the desired bias fails to find an equippable item for a given slot, it will look at the 'default' slot and see if it can find something there to equip.
My default bias is basically ML increasing combat gear, with nice high DA and phat item drops. (jeks).

You can expect some more updates, especially as I clean up the code (it evolved from a previous version, which had hardcoded outfit info) and, of course, fix bugs!

On the TODO list for this script:

  • [li]Cleaner accessory handling code, especially with regards to handling 'only equip one' items[/li]
    [li]Fix a weird bug where it unequips an item, then re-equips that same item.[/li]

Without any further ado, here are the files in question!

EDIT: first bug fixed! Offhand items are now handled properly, if hands are full, dont even try the offhand slot.

UPDATE: check if we can actually equip offhand weapons or shirts.

UPDATE: added better conditional code for MP reduction, the script no longer assumes you have a navel ring...

UPDATE: Added accessory shuffling when moving about 'only equip one' accessories.
 

Attachments

  • custom_outfits.txt
    5.1 KB · Views: 225
  • outfit_change.ash
    9.4 KB · Views: 111

izchak

Member
Update! (if anyone cares).

Some new features were added, and I'm going to do a better description of this scripts usage, as it occurs to me that my original post is a little unclear on that.

This was written as a namespace script (type "using outfit_change.ash" into your CLI) to let me swiftly change outfits to fit my current situation.

Let me give a brief rundown of the custom outfits I currently have defined first, and what I use them for

  • [li]default : this is the default outfit. If another outfit doesnt find something for a slot (hat, pants, accessory, etc), it looks here for an alternative[/li]
    [li]nightdress : this is my rollover outfit. It tries to equip what I consider the best rollover gear first, and if it cant, it uses lesser gear. (pike > time swords)[/li]
    [li]noncombats : what with ML influencing your noncombat buffs now, I use this one a lot. Basically, its a ring of conflict, white whip, pilgrim shield, with no +ML boosters.[/li]
    [li]ML : when I dont care about noncombats, I use this one. Sickle, scarf, carnivore buttons.[/li]
    [li]ML+ : monster bait, sickle, scarf, buttons.[/li]
    [li]itemz : all the +items gear I can muster[/li]
    [li]items : a fair amount of +items gear, for when I prefer wearing, say, a pith helmet instead of an ice pick[/li]
    [li]pvp : high powered hats, pants, shirts, and a bunch of stat boosting accessories. Oh, and bar whips.[/li]
    [li]regen : MP regenerating garb, for shoring, templing, etc.[/li]
    [li]init : +combat initiative garb, for getting the jump on my shadow[/li]
    [li]hp : stuff to increase my max HP, for bruteforcing the skeleton[/li]

If you've imported this script into your namespace ("using outfit_change.ash"), you can just type 'best_outfit nightdress' to switch to the predefined nightdress outfit.

Here's a summary of the commands, including the new ones.


  • [li]best_outfit <outfitname> : This switches to the desired outfit, trying to equip the best stuff possible, as defined in the custom outfits file.[/li]
    [li]show_outfit <outfitname> : [NEW] this prints out the outfit info from the custom outfits file. Useful when adding stuff to the file, so you can check if you got the spelling right.[/li]
    [li]show_outfits : [NEW] this just prints out all the outfit info. Pretty verbose.[/li]
    [li]reload_outfits : [NEW] this reloads the custom outfits file. This is useful when you add stuff to the file, as mafia appears to cache the file in memory, only re-reading it if the main script is altered.[/li]

You can actually call this script normally, without importing it into your namespace. it will then prompt for a string, and try equip that outfit.

It's worth noticing that I try to equip MP reducing gear wherever possible, because I like to save MP, even if it means 15 less ML. This feature can be turned off, and outfits can be made exempt from MP reduction outfitting.

Finally, I managed to get the jeks to juniors comparison code working. If a request is made to equip a jek belt, and it happens to be one of those days where juniors are superior, AND you have a junior, it will equip the junior instead.

Last, but not least, I put a 'notify' statement at the top of the file, because I wonder if anyone else actually uses this, or if people just compulsively download scripts to peek at code. I know I download scripts just to peek at code!
 

cankergoyle

New member
Heh. I tried and failed to use the last version, mainly because I didn't know how to invoke it and didn't have the time to figure it out. so more info on that is much appreciated. cheers.
 

SeiferTim

New member
A couple of things:

First, this script is great! I've been using it for awhile now, and love it.
I made a few minor tweaks to the code in order to make it work for a few things (I'll attach my modified script at the end)... I added familiar equipment and the ability to take out a particular familiar. I also re-ordered the slots, because I ran into a few problems. First, I couldn't set up an outfit for my Sauceror to be able to use both a Chefstaff and a Special Sauce Glove... in the default order of the script, it would try to equip the staff, say that I couldn't, and then equip the Special Sauce Glove. This seemed to work great up until I started the Frat/Hippy War. I had an outfit setup for the following:
Code:
WarFrat	acc1	0	special sauce glove
WarFrat	acc1	1	navel ring of navel gazing
WarFrat	acc1	2	bejeweled pledge pin
And another one that was setup like this:
Code:
WarHippy acc1	0	special sauce glove
WarHippy acc1	1	navel ring of navel gazing
WarHippy acc1	2	round purple sunglasses

Everytime I tried to change outfits, the Cli would show the following:
Code:
> best_outfit WarFrat

Putting on bejeweled pledge pin...
Equipment changed.
Purchasing special sauce glove (1 @ 5,000)...
You acquire an item: special sauce glove Purchases complete.
Putting on special sauce glove... 
You may only equip one of those at a time.

I already had a Special Sauce Glove....I don't know why it keeps buying new Gloves... I now have 6 of them.
Other than that, I think this script is amazing! Thanks a lot for making it!

Also, is there anyway to setup 2 different default outfits for 2 different characters?
My fiancé says that it keeps trying to equip her with items that she doesn't have but which are in the default outfit...

Edit: I'm going to go ahead and remove the code to equip the familiar, but I would still like to know if anyone has any ideas about the special sauce gloves.
 

Attachments

  • outfit_change.ash
    7.8 KB · Views: 75

izchak

Member
First post updated, it should now do some checking for torso awaregness and skullsmashing, when equipping those items.

Seifertim : Thanks for posting, I'm happy to know there is someone actively using this script, and finding it useful!
As for the issue you describe : Are you using one of the new daily builds, or an older version of mafia?
I've been having issues with the newer daily builds, which would cause behaviour like you describe. If not, I'll take a closer look at it, and see if I can track down whats causing that issue. It *might* be the way I handle accessories, and I think it could be repaired using Veracity's very useful 'get item enchantments/abilities' ASH functions, which I haven't taken a close look at yet.
 

SeiferTim

New member
I am using the daily builds. I found that if I simply setup my default outfit to have the special Sauce glove equipped as acc1 2, and then not have it listed in the other outfits (only have acc1 0 and acc1 1), it doesn't try to buy new gloves. Since I'm not going to be unequipping my special sauce glove until I perm the skill that has the same effect (forgot what it was called) this solution is good for the time being. Thanks!
 

izchak

Member
Bump. A minor update has been made for the MP reduction code, the script no longer assumes you have a navel ring, and actually CHECKS to see if you have one before trying to equip it. Whoops.
The default MP reduction order is now : plexi glass watch OR navel ring OR baconstone bracelet. It'd be fairly trivial to add the other MP reducing items that are out there, should anyone require it. As for me, glass watch and navel ring are all I use.
 
I'm trying this out, but in the hardcore context, so I'm going to have to modify the txt file a lot. :)

A few questions:

[quote author=izchak link=topic=1180.msg5674#msg5674 date=1188772908]
Let me give a brief rundown of the custom outfits I currently have defined first, and what I use them for

  • [li]noncombats : what with ML influencing your noncombat buffs now, I use this one a lot. Basically, its a ring of conflict, white whip, pilgrim shield, with no +ML boosters.[/li]
[/quote]
Why white whip? I wasn't aware of a noncombat effect (and don't see one on the wiki).

If I wanted to add support for Yendorian Finery for the noncombat outfit, but _only_ if I had the whole outfit, is it possible to do that?
 

SeiferTim

New member
[quote author=Mighty Xerxes link=topic=1180.msg6026#msg6026 date=1193862557]
I'm trying this out, but in the hardcore context, so I'm going to have to modify the txt file a lot. :)

A few questions:


Why white whip? I wasn't aware of a noncombat effect (and don't see one on the wiki).

If I wanted to add support for Yendorian Finery for the noncombat outfit, but _only_ if I had the whole outfit, is it possible to do that?

[/quote]

It would be simple enough to make a new script that said something like:
Code:
if(have_outfit('Yendorian Finery'))
{
     outfit('Yendorian Finery');
} else {
     cli_execute("best_outfit combatfreq");
}

I guess you could change this script to give precedence over a specific outfit only if you have all the items, but I wouldn't know how that would work in the map file...
 

izchak

Member
The white whip was basically there as an alternative to an ice sickle due to the whole ML nerfing noncombats mechanic. I want stats and noncombats, damnit!
I now use a bottle-rocket crossbow instead of the white whip (orange rockets FTW).

As for the Yendorian Finery, I'm aware of it, and plan to work it in at some point such that it would equip that entire outfit if its possible and useful. I'm just trying to think of a 'clean' way to work it in, as compared to a cheap hack that would mostly work ;)
 
Thanks. After I've been through an ascension or four, I'll post whatever I come up with as an HC outfit map, based on equipment that is likely available in an HC run. I'll probably post over at the HCN boards for ideas first, before I post here, since this board is more technically oriented, and that one more focused on the strategery.
 

kain

Member
This script will be invaluable when I basement dive ... instead of setting custom outfits, I can just set up scripts for hp+ or mp+ or moxie+

I hadn't downloaded this script until now, and I need to fit it into my other scripts now.

<edit>
I had to giggle when I came across this line:
Code:
# because that would fail when trying to equip, say, three jek belts
one can wish, I suppose
 
I think there is a bugin your script... When I have a bottle-rocket crossbow in my inventory (only 1). I get an error when it gets to the weapon slot, it says, "You can't dual wield weapons" I'mnot trying to dual wield weapons... Bottle-rocket crossbow in the weapon slot... ;)

Any ideas?

Maybe somewhere add in a line that reads something of the form of,
if(have_skill($skill[double fisted furry])){ #I think its that skill
equip multiple weapons
}
else{
equip only 1
}

Sounds easy in theory at least (I'm just not sure where to put the code)... Thanks again for writing this script. it's extremely useful!
 

izchak

Member
[quote author=GhettoTrucker link=topic=1180.msg6124#msg6124 date=1195029424]
I think there is a bugin your script... When I have a bottle-rocket crossbow in my inventory (only 1). I get an error when it gets to the weapon slot, it says, "You can't dual wield weapons" I'mnot trying to dual wield weapons... Bottle-rocket crossbow in the weapon slot... ;)

Any ideas?

Maybe somewhere add in a line that reads something of the form of,
if(have_skill($skill[double fisted furry])){ #I think its that skill
equip multiple weapons
}
else{
equip only 1
}

Sounds easy in theory at least (I'm just not sure where to put the code)... Thanks again for writing this script. it's extremely useful!
[/quote]
Hmm. The script already has some code which should stop it from trying to dualwield weapons if you lack skullsmashing. I have skullsmashing, so I haven't tested it extensively, but I did test it, and I recall it working.
Could I get a little more input as to the nature of the error?
For instance, which outfit are you trying to outfit when the error occurs?
Is it an outfit that has a bottle rocket crossbow in the mainhand, and the offhand, but you only have one crossbow?
Do you, in fact, have double-fisted skullsmashing?

[quote author=hippymon link=topic=1180.msg6128#msg6128 date=1195082187]
Yea, I get all kinds of problems dealing with weapons....
[/quote]

What kinds of problems are you having, hippymon?
I can't fix problems if I don't know what they are ;)
 

hairball

New member
I think I'm going to like this script, have not tried it yet.

However, I frequently ascend into a different class and find that what worked well for my Pastamancer or Sauceror isn't that great for my Seal Clubber.

It would be cool if the script could have a custom outfits file for each character class - seal_clubber_outfits.txt, etc. that one could copy/paste and tweak as they see fit. I suppose I could prefix each bias with my class - SC_rollover, SC_whatever, etc. and that would work the same way.

In any case, I'll be trying this out later tonight and will see how I like it.
 

Taria

New member
This looks like it could be quite useful, since I often end up using a relatively similar set of items in many ascensions.

I do have one question though. Since I do hardcore runs, there are certain items that I like, but don't always have. Does this script do anything for seeing if you have an item before equipping it, and move on to the next alternative if not?
 

hairball

New member
[quote author=hairball link=topic=1180.msg6213#msg6213 date=1196568190]

I think I'm going to like this script, have not tried it yet.

However, I frequently ascend into a different class and find that what worked well for my Pastamancer or Sauceror isn't that great for my Seal Clubber.

It would be cool if the script could have a custom outfits file for each character class - seal_clubber_outfits.txt, etc. that one could copy/paste and tweak as they see fit. I suppose I could prefix each bias with my class - SC_rollover, SC_whatever, etc. and that would work the same way.

In any case, I'll be trying this out later tonight and will see how I like it.
[/quote]

Bah, forget all this - if I'm in a run I'm in it for a long time. So I can have 7 different files and just rename them at the beginning of a run.

I just used it to get into my rollover outfit and it worked great. The only thing is that I currently have 2 mr. accessories (hehe, maybe not for long!) and it only equipped one of them. But ya know for rollover that means nothing. I imagine it'd do the same for regular adventuring though.

I love the concept - it basically equips the best of what you have available at the moment, and it's pretty easy to configure. I have a feeling it's going to be one of my most useful scripts for a long time.
 
Top