autoBasement.ash - Better basement automation

ajandaj, what version of mafia are you using? If it's an older one, please update to the latest daily build and see if that solves your problem.
 
Ah, yep... he missed a semicolon there. Take this line:
Code:
string maximize_familiar
and throw a semicolon on the end, like this:
Code:
string maximize_familiar;
All should be well again. :)
 
Arrgh! I hate it when I do that, I really should verify my script changes, even if they are small and insignificant... Correct version uploaded to 2nd post (soonish).
 
Thanks Winterbay, also what about an option to select your own combat outfit? I've found it easiest to maximize %spell damage (+470% or so) and use an uncapped spell for most combats but the script (rather modifier maximizer) doesn't look like it can handle %spell maximization. Since you have to craft a CCS to handle the combats for you anyway it seems pretty intimately tied to your outfit selection.

maybe a way around it is to list every piece of gear in your outfit under autoBasement_combat_equipment ?

Update: well looks like that workaround does the trick :)
 
Last edited:
You can set the items you want to use in fights with one of the settings (autoBasement_combat_equipment) which is a comma-delimited list of items to equip in fights. You can add all your items in the outfit you want to use there. I'll think about perhaps adding another setting for a complete outfit but until then that setting is your best bet.
 
That setting works fine, and would let you define a couple outfit pieces and let maximizer figure out the rest if you wanted. Probably ends up being more versatile than a straight outfit change

On a different note the script seems to continue using my sandworm now even after all 5 drops have happened. Strange because it did get 1 drop each from the rogue/llama earlier but now just uses sandworm.

Update: looking at the code "item_drop" will always equal 0 because I don't have a badger/pixie/xenomorph so when it comes to evaluate:

else if ( get_familiar_drops && get_property( "_gongDrops" ).to_int() <= item_drop && have_familiar($familiar[llama lama]) )
{
use_familiar($familiar[llama lama]);
}

the script will only ever get one gong drop, because then _gongDrops will be > 0
 
Last edited:
I think I've fixed it now. Basically it should set a variable for each familiar and if you don't have it available to you that variable is set to 5 meaning that it should be skipped in the logic further down.
 
Hey Winterbay, noticed I got 0 agua, 5 token and 5 gong, then the script would keep using the llama lama for every combat thereafter.

Code:
else if ( get_familiar_drops && get_property( "_gongDrops" ).to_int() <= item_drop && have_familiar($familiar[llama lama]) )

I think due to the <= comparison once 'item_drop' equals 5 the script will always choose the first drop familiar you have, in my case the llama.
 
Haha we can't win this one Winterbay. Now at the beginning of the day when '_gongDrops' == 0 it isn't lessthan item_drop, it is equal to it (both are 0) so the script just goes right to the sandworm!

Wonder if it would be easier to just get all 5 drops from one familiar then move onto the next, then it could be a hard check of _gongDrops < 5 etc. They all drop pretty fast now since that change a month or two ago.

Also I've noticed this before you took over management of the script from Rinn. The script sometimes fails high level elemental tests because it can't get enough HP, apparently because it isn't maximizing resistance against elements properly? Like this example:

Code:
Basement level 383: Sleaze & Stench Elemental Resistance Test
Maximizing...
84672 combinations checked, best score 115.83
Putting on battered old top-hat...
Equipment changed.
Wielding lawn dart...
Equipment changed.
Holding lawn dart...
Equipment changed.
Putting on sea salt scrubs...
Equipment changed.
Putting on sugar shorts...
Equipment changed.
Putting on V for Vivala mask...
Equipment changed.
Putting on slime-covered necklace...
Equipment changed.
Putting on slime-covered necklace...
Equipment changed.
Putting Head Trauma the Llama Lama back into terrarium...
Taking Stripper Codename: Lexus the Exotic Parrot out of terrarium...
Stealing little box of fireworks from Head Trauma the Llama Lama...
Putting on little box of fireworks...
Equipment changed.
Using 1 philter of phorce...
You acquire an effect: Phorcefullness (duration: 10 Adventures)
Finished using 1 philter of phorce.
Searching for "Ben-Gal™ Balm"...
Search complete.
Purchasing Ben-Gal™ Balm (1 @ 24)...
You acquire an item: Ben-Gal™ Balm
You spent 24 Meat
Purchases complete.
Using 1 Ben-Gal™ Balm...
You acquire an effect: Go Get 'Em, Tiger! (duration: 3 Adventures)
Finished using 1 Ben-Gal™ Balm.
Using 1 Ferrigno's Elixir of Power...
You acquire an effect: Incredibly Hulking (duration: 10 Adventures)
Finished using 1 Ferrigno's Elixir of Power.
Using 1 blood of the Wereseal...
You acquire an effect: Temporary Lycanthropy (duration: 10 Adventures)
Finished using 1 blood of the Wereseal.
Using 1 milky potion of ettin strength...
You acquire an effect: Strength of Ten Ettins (duration: 10 Adventures)
Finished using 1 milky potion of ettin strength.
Using 1 Mick's IcyVapoHotness Rub...
You acquire an effect: Extreme Muscle Relaxation (duration: 10 Adventures)
Finished using 1 Mick's IcyVapoHotness Rub.
Using 1 unstable DNA...
You acquire an effect: Yuletide Mutations (duration: 10 Adventures)
Finished using 1 unstable DNA.
Searching for "black facepaint"...
Search complete.
Purchasing black facepaint (1 @ 300)...
You acquire an item: black facepaint
You spent 300 Meat
Purchases complete.
Using 1 black facepaint...
You acquire an effect: Black Face (duration: 10 Adventures)
Finished using 1 black facepaint.
Using 1 fish-liver oil...
You acquire an effect: Fishy Fortification (duration: 5 Adventures)
Finished using 1 fish-liver oil.
Searching for "pirate brochure"...
Search complete.
Saving outfit: Backup
Outfit saved
Putting on outfit: Swashbuckling Getup
Equipment changed.
Purchasing pirate brochure (1 @ 300)...
You acquire an item: pirate brochure
You spent 300 Meat
Purchases complete.
Using 1 pirate brochure...
You acquire an effect: Muscularrr (duration: 10 Adventures)
Finished using 1 pirate brochure.
Putting on outfit: Backup
Equipment changed.
unable to pass elemental test, quitting

It had the proper phial on, but then thought I needed 14000 HP to survive. I manually typed 'maximize sleaze res' into the command line and easily passed with 2000hp. Why would it try to equip lawn darts and stuff instead of resist gear?
 
Last edited:
I quite like getting drops from the different ones and even though the change did make it less of a hassle I still think it is nicer this way. I have thus changed it to look for "<" if the value is bigger than 0 or otherwise return true.

On the maximizing thing I'm not sure, the code follows this flow:
1) Set element_familiar to Parrot or Disembodied hand if that's not available, or keep the current one otherwise
2) Maximise with the following: ("maximize .5 " + to_string(elem1) + " resistance, .5 " + to_string(elem2) + " resistance, 0.01 hp" + element_familiar) - i.e. maximize for both elements first
3) Uneffect any negative phials
4) Check if we can pass
4a) If we can't and have not used a phial, use a phial and maximise again but now with the command: ("maximize " + to_string(elem2) + " resistance, 0.01 hp" + element_familiar) - i.e. we now use only the element we do not have a phial against.
5) Test if we can pass and if not try to buff our max_hp
6) Test again, return true if we can pass, or false otherwise

This indicates that it should try to maximise against the one element, even though I guess if you have used the correct phial in an earlier test you could end up with a problematic situation where it doesn't optimise its maximisation for the element you are not phialed against.

Nevertheless, new version uploaded to fix familiar droppings, again :)
 
I ran about 200 adventures with this script today and ended up with :

absinthe = 1/5
agua = 5/5
astral = 1/5
gong = 1/5
transponder = 1/5

How does the logic to determine what drops to try for work ? Am I doing something wrong ?
 
Did you download the latest version before running? (I've been poking at that logic rather much lately...)
Also, how many combats did you have?

Looking at the code I can't see a reason why it should favour the sandworm that much, unless it somehow has decided that when you have one of each skip the otehritem familiars and I've misunderstood what I've written... :)
 
Did you download the latest version before running? (I've been poking at that logic rather much lately...)
Also, how many combats did you have?

Looking at the code I can't see a reason why it should favour the sandworm that much, unless it somehow has decided that when you have one of each skip the otehritem familiars and I've misunderstood what I've written... :)

I think I downloaded the latest version.

It has this line near the bottom:

check_version("AutoBasement","AutoBasement","2.0",3113);

Is that the latest ?

This looks like the relevant code from the version I am using:

PHP:
if(to_familiar(vars["is_100_run"]) == $familiar[none])
            {
                int mushrooms = (have_familiar($familiar[astral badger]) == true ? to_int(get_property( "_astralDrops" )) : 5);
                int absinths = (have_familiar($familiar[green pixie]) == true ? to_int(get_property( "_absintheDrops" )) : 5);
                int gongs = (have_familiar($familiar[llama lama]) == true ? to_int(get_property( "_gongDrops" )) : 5);
                int tokens =  (have_familiar($familiar[rogue program]) == true ? to_int(get_property( "_tokenDrops" )) : 5);
                int transponders =  (have_familiar($familiar[li'l xenomorph]) == true ? to_int(get_property( "_transponderDrops" )) : 5);
                int item_drop = min(5,min(mushrooms,min(absinths,min(gongs, min(tokens, transponders)))));
                
                if (get_familiar_drops)
                {
                    if ((mushrooms == 0 ? true : mushrooms < item_drop) && have_familiar($familiar[astral badger]))
                    {    
                        use_familiar($familiar[astral badger]);
                    }
                    else if ((absinths == 0 ? true : absinths < item_drop) && have_familiar($familiar[green pixie]))
                    {    
                        use_familiar($familiar[green pixie]);
                    }
                    else if ((gongs == 0 ? true : gongs < item_drop) && have_familiar($familiar[llama lama]))
                    {
                        use_familiar($familiar[llama lama]);
                    }
                    else if ((tokens == 0 ? true : tokens < item_drop) && have_familiar($familiar[rogue program]))
                    {
                        use_familiar($familiar[rogue program]);
                    }
                    else if ((transponders == 0 ? true : transponders < item_drop) && have_familiar($familiar[li'l xenomorph]))
                    {
                        use_familiar($familiar[li'l xenomorph]);
                    }
                    else if (have_familiar($familiar[baby sandworm]))
                    {    
                        use_familiar($familiar[baby sandworm]);
                    }
                    else if (have_familiar($familiar[hovering sombrero]))
                    {
                        use_familiar($familiar[hovering sombrero]);
                    }
                }
            }
            else
                use_familiar(to_familiar(vars["is_100_run"]));

I would mess with it myself but I don't understand what the "?" and ":" do in the integer definitions and conditionals.


I'm not sure how to determine how many adventures were combats without going to the session log and counting them all by hand. A quick look at adventure numbers shows I spent 225 advs with the script. Surely there were enough combats that some of those familiars should have gotten more than one drop ?

Edit: Could the fact that I have no rogue program but do have the others be affecting things somehow ?
 
Last edited:
I think the problem is this part:
Code:
mushrooms < item_drop
(and the other < item_drop bits as well)

The issue is, if you have 1 drop, the number is not less than itself... it's equal to itself. So as soon as you've gotten a single drop of each type, the lowest drop count is 1, and so it skips on to the next. Eventually, once each of them is equal to the lowest count, it uses your sombrero or sandworm.

Change like this:
Code:
mushrooms <= item_drop
to each and it should work. Also, changing it like that should be able to eliminate the first part, so that the whole line becomes:
Code:
if (mushrooms <= item_drop && mushrooms < 5)
instead of
Code:
if ((mushrooms == 0 ? true : mushrooms < item_drop) && have_familiar($familiar[astral badger]))
Why? Because above, if we didn't have a badget, we already set mushrooms to 5... we don't need another check if we still have a badger. We need to check if mushrooms is less than 5, because we're now using an equals check, and we don't want to get stuck on using the badger forever instead of the sandworm, so... :)
 
Back
Top