autoBasement.ash - Better basement automation

mstieler

Member
Does this script try to use Slime potions? I've got them all identified; would their randomness-per-ascension thing bve an issue, or can you script for the effect if you've got all of them identified? They'd seem to be a cheap* +50-250% stat boost.

*Cheap regarding that you don't buy them but do have to farm them.
 

Winterbay

Active member
I think it does, I seem to remember my Sauceror doing that when I tried the script last time. It's been a while though so I can be wrong... :)
 

mstieler

Member
They show up in the dropdown menu, but aren't one of the "auto-used" items. By that I mean in this case:
Code:
 > Basement level 396: Moxie Test
custom outfit Moxie

buy 1 serum of sarcasm for 364 each from 1877436 on 20110927
You acquire an item: serum of sarcasm

use 1 serum of sarcasm
You acquire an effect: Superhuman Sarcasm (duration: 15 Adventures)

buy 1 Connery's Elixir of Audacity for 1545 each from 1699424 on 20110927
You acquire an item: Connery's Elixir of Audacity

use 1 Connery's Elixir of Audacity
You acquire an effect: Cock of the Walk (duration: 15 Adventures)

buy 1 hair spray for 24 each from Market Demon
You acquire an item: hair spray
You spent 24 Meat

use 1 hair spray
You acquire an effect: Butt-Rock Hair (duration: 3 Adventures)

buy 1 dark potion for 120 each from 196620 on 20110927
You acquire an item: dark potion of blessing

use 1 dark potion of blessing
You acquire an effect: Izchak's Blessing (duration: 10 Adventures)

buy 1 Black Body™ spray for 300 each from 1945689 on 20110927
You acquire an item: Black Body™ spray

use 1 Black Body™ spray
You acquire an effect: Radiating Black Body™ (duration: 10 Adventures)
outfit Swashbuckling Getup

buy 1 pirate pamphlet for 300 each from Barrrtleby's Barrrgain Books (Bees Hate You)
You acquire an item: pirate pamphlet
You spent 300 Meat

use 1 pirate pamphlet
You acquire an effect: Charrrming (duration: 10 Adventures)
custom outfit Backup

buy 1 jellyfish gel for 900 each from 456149 on 20110927
You acquire an item: jellyfish gel

use 1 jellyfish gel
You acquire an effect: Old School Pompadour (duration: 10 Adventures)
I have a feeling that Slime Potions could have covered a chunk of the items used, whether the Sarcasm & Connery's, or the misc. potions afterward. Granted, it's not like it's saving a heap of money, but a 0-cost item seems like it would get used before an any-cost item. And no, I'm not going with the "it's in my inventory, so it's zero-cost", as Bale said above, use it or lose it.
 

Pazleysox

Member
So, in my infinite (lol) wisdom, I was able to figure out what the problem was.

I went from this:
Code:
		outfit("Muscle");
to this:
Code:
//		outfit("Muscle");

I had to go into the script, and edit out all the initial outfit changes. It seems the script was putting on the outfit BEFORE it would maximize it, and as a result it would crash. Once I took that line out, the script works beautiful.

-Paz
 
Last edited:

slyz

Developer
Instead of commenting out those lines, would you replace them with:
PHP:
if ( outfit("Muscle") ) {}
and tell us if the script still works?
 

Winterbay

Active member
They show up in the dropdown menu, but aren't one of the "auto-used" items. By that I mean in this case:

I have a feeling that Slime Potions could have covered a chunk of the items used, whether the Sarcasm & Connery's, or the misc. potions afterward. Granted, it's not like it's saving a heap of money, but a 0-cost item seems like it would get used before an any-cost item. And no, I'm not going with the "it's in my inventory, so it's zero-cost", as Bale said above, use it or lose it.

The script has no drop down as far as I know, I guess that the Mafia basement helper has that but that has nothing to do with the script, they are completely unrelated. Or am I misunderstanding you?
 

Winterbay

Active member
Instead of commenting out those lines, would you replace them with:
PHP:
if ( outfit("Muscle") ) {}
and tell us if the script still works?

I think a more interesting edit would be
PHP:
if ( outfit("Muscle") ) {
} else { 
	print("Error equipping Muscle");
	foreach n,it in outfit_pieces("Muscle") {
		print("You have " + available_amount(it) + " of " + it + ". can_equip() returns " + can_equip(it) + ".");
	}
}

which would also potentially show what is causing the problem...
 

Pazleysox

Member
I think a more interesting edit would be
PHP:
if ( outfit("Muscle") ) {
} else { 
	print("Error equipping Muscle");
	foreach n,it in outfit_pieces("Muscle") {
		print("You have " + available_amount(it) + " of " + it + ". can_equip() returns " + can_equip(it) + ".");
	}
}

which would also potentially show what is causing the problem...


Well, it seems that now the script is working. Since it was able to equip the outfits, it runs awesome now. It doesn't explain WHY it happened though!

-Paz
 

slyz

Developer
Regarding the outfit() thing, Mafia goes into an ERROR_STATE if "You only put on part of that outfit." or if "You're already wearing as much of that outfit as you can.", or any other such error.

The result should be that outfit() returns false and cache_outfits() should continue on its merry way. Apparently, what happens is that, if the return value of outfit() isn't captured, the script simply exits.

I can reproduce this by trying to equip an outfit I know KoL will refuse to equip:
PHP:
void test()
{
	print( "changing outfit" );
	outfit( "castle" );
	print( "outfit changed" );
}

void main()
{
	print( "start test" );
	test();
	print( "end test" );
}
results in:
Code:
> call test.ash

start test
changing outfit
Putting on outfit: castle
[color=red]This outfit contains an item which is not equippable in hardcore. Nice try, though.[/color]

The same kind of thing happens with adventure(), and probably other build-in functions. I'll open up a bug report to try to track this down. Meanwhile, simply capturing the return value of outfit will avoid any problem.
 

mstieler

Member
How do you run it? In the relay-browser to from the script drop-down menu in the main Mafia window?

I run your script from the main Mafia window. When it hits a snag (or purposefully stops) then I hit the relay browser to see what all I can do via Mafia's dropdown relay basement helper thingy. After I'm buffed, then I'll either manually adventure or run your script from the main Mafia window once more.

By "main Mafia window" I mean the bit that pops up after you log in, with the Purchases/Gear Changer/etc tabs, the two dropdowns to select from assorted features (Daily Deeds, Location Details, etc.), and all the rest.
 

Pazleysox

Member
Here's what my script looks like now.

Code:
	if (outfit_exists(custom_outfits, "Mysticality"))
	{
		strip_familiar("Mysticality");
		switch_hand("Mysticality");
if ( outfit("mysticality") ) {
} else { 
    print("Error equipping mysticality");
    foreach n,it in outfit_pieces("mysticality") {
        print("You have " + available_amount(it) + " of " + it + ". can_equip() returns " + can_equip(it) + ".");
    }
} 
		outfit("Mysticality");
	}
	cli_execute("maximize Mysticality" + maximize_familiar);
	cli_execute("outfit save Mysticality");
	familiarCache["Mysticality"].f = my_familiar();
	familiarCache["Mysticality"].i = familiar_equipped_equipment(my_familiar());

and here's the error that I get when running the script:

Code:
> call scripts\autoBasement.ash

Initializing items and effects...
Items and effects initialization complete!
Caching outfits...
Putting on outfit: Mysticality
You only put on part of that outfit.
Error equipping mysticality
You have 1 of Hodgman's porkpie hat. can_equip() returns true.
You have 2 of Hodgman's whackin' stick. can_equip() returns true.
You have 1 of Hodgman's imaginary hamster. can_equip() returns true.
You have 1 of sea salt scrubs. can_equip() returns true.
You have 1 of Hodgman's lobsterskin pants. can_equip() returns true.
You have 4 of Talisman of Baio. can_equip() returns true.
You have 4 of Talisman of Baio. can_equip() returns true.
You have 4 of Talisman of Baio. can_equip() returns true.
Putting on outfit: Mysticality
You're already wearing as much of that outfit as you can.

This is the same error I was getting before, now with the modification of the code, you can see what the error is.

-Paz
 

Winterbay

Active member
Hmm... That really should work. A few more questions:
1) What is your current familiar?
2) What happens if you unequip everything and manually choose that outfit from the Mafia-drop down?
3) If you go to the relay browser and click on "Manage your Custom Outfits". Does the content of the Mysticality outfit line up with what Mafia thinks it should contain according to the print out?
 

Theraze

Active member
Also, try this...
storage_amount talisman of baio
closet_amount talisman of baio
item_amount talisman of baio
I recently had an issue where it tried to equip my (worn) ascot repeatedly. I had one ascot worn and one in storage, and the maximizer was offering both to me, but wouldn't retrieve the item from storage when needed... Unfortunately, I didn't do enough troubleshooting before I figured out what was happening to write a useful bug note, but hopefully that's just your problem there...
 

Pazleysox

Member
Hmm... That really should work. A few more questions:
1) What is your current familiar?
2) What happens if you unequip everything and manually choose that outfit from the Mafia-drop down?
3) If you go to the relay browser and click on "Manage your Custom Outfits". Does the content of the Mysticality outfit line up with what Mafia thinks it should contain according to the print out?

1) My current familiar is a bandersnatch
2) it equips the outfit that it wants
3) yes

-Paz
 

Theraze

Active member
Any chance you can run those three I mentioned? At least, if aB is still having this error. If it's fixed, tis less important to check, since it's not replicable anymore... but I'd still be curious.
 

mstieler

Member
Is there a way to have the script automatically re-stick 3 wrestler stickers when a Scratch N Sniff Sword/Crossbow's sticker fall off? It seems to be the main workaround for me (since I'm in the "2 Whackin' Stick" boat).
 
Top