autoBasement.ash - Better basement automation

Ferdawoon

Member
Have you opened up the basement? I know I've failed to do that on occation :)
Also, the script ran just fine today and yesterday for a 2 day basement run. Only 1 more to go now.

Ehhm.. Ooops..
Have to try this tomorrow then. Opening the Basement tend to take a few turns more than the 19 I have left today..
I did the same mistake last run, so one would think I have learned my lesson but Oh noes..
Btw, do you have the Disembodied Hand? Been checking the Bug thread I made about it and got no "This is now Fixed" tag on it so I'm a bit paranoid that it is not fixed and I spend a few days leveling up just to find that it is not fixed =(
 

Ferdawoon

Member
Yeh that is where the script, or maybe Mafia, break things for me. It cannot switch between outfits where the MainHand of the new outfit is used by the Disembodied Hand of the old outfit.
 

slyz

Developer
Ehhm.. Ooops..
Have to try this tomorrow then. Opening the Basement tend to take a few turns more than the 19 I have left today..
I did the same mistake last run, so one would think I have learned my lesson but Oh noes..
Add this somewhere before the basement() function
PHP:
string safe_visit_url(string url, boolean post, boolean encoded) {  
   string res;  
   try { res = visit_url(url,post,encoded); }  
   finally { return res; } return res;  
}
string safe_visit_url(string url, boolean post) { return safe_visit_url(url,post,false); } 
string safe_visit_url(string url) { return safe_visit_url(url,true,false); }
and replace line 553
PHP:
string page = visit_url("basement.php");
with:
PHP:
string page = safe_visit_url("basement.php");
if ( page = "" ) abort( "Make sure to unlock The Ruins of Fernswarthy's Tower and try again." );
 

temptemp9

New member
Holding scratch 'n' sniff crossbow...
That's not an item, or it's not something you own.

I've found that replacing the wrestler stickers can be a workaround (in order to make the scratch'n'sniff sword/crossbow not optimal for a given stat outfit), but the main issue still remains.
 

Ferdawoon

Member
Well, it would seem that the minions and developers agree that I'm in the wrong here and that what I get is a feature and not a bug and that it should be solved within the autoBasement.ash.

Anyone mind helping me here? =S
Is it possible to retrieve information about an outfit before changing to it, and see if the item in Mainhand or Offhand is the same as the Disembodied Hand's familiarequipment, and if so, unequip familiarequipment before doing an outfitchange?

And Cheers slyz! I assume "before Basement()" means "before void basement(int num_turns)" as that seem to be the closest =S
 
Last edited:

lostcalpolydude

Developer
Staff member
familiar_equipped_equipment($familiar[disembodied hand]) will tell you what the hand is wearing. outfit_pieces("outfit name") will list the items in the outfit. I imagine the most straightforward approach is to check each item, see if you have one of it in inventory (or equipped), if not then check and see if your hand (and hatrack if you want) are wearing it, then grab the equipment if needed.
 
hi all - getting this error when i try to run the version that's currently attached (which looks like it hasn't been updated in some time)

Cannot apply operator ^ to level (int) and 1.4 (float) (autoBasement.ash, line 384)

I know the mafia devs switched some stuff around recently with this syntax - can someone help me get this functioning again?
 

slyz

Developer
The devs changed the meaning of "^". Exponant is now "**".
You can use this version with "**" instead of "^".
 

Attachments

  • autoBasement.ash
    31.1 KB · Views: 39
thanks, i hadn't seen this posted.

hmm weird, now i keep getting this:

Putting on outfit: Damage
Equipment changed.
Maximizing...
152 combinations checked, best score 1124.0
Holding Uncle Hobo's highest bough...
That's not an item, or it's not something you own.

I do have the bough, and if I look at my equipment I'm holding it in my off-hand. I tried unequipping it and restarting auto-basement, but same error.

you know i almost wonder if the problem is that my "Muscle" outfit already equipped it, and the "Damage" one wants to equip it in a different slot?

Scratch that - both outfits have the bough in the offhand. i'm at a loss.
 
Last edited:

Theraze

Active member
Do you have a disembodied hand or a hatrack? Are they wearing any of the items that are a part of either outfit? If not, does it work if you strip the character and rerun the script?
 

jwylot

Member
The scratch 'n' sniff crossbow is pretty certainly sitting in my inventory. Any suggestion? TIA.

Edit: I've already tried to unequip everything and wielding the crossbow in the off hand, at no avail.
Have you tried running maximize from the cli to see what is happening in a bit more detail?
 

Winterbay

Active member
I might have a solution to the disembodied hand/hatrack problem. Does anyone (with that problem) want to test it out and see if it helps?
 
Do you have a disembodied hand or a hatrack? Are they wearing any of the items that are a part of either outfit? If not, does it work if you strip the character and rerun the script?

I do have, and use, a hatrack, but I've got it using a hat that is not present in any of my outfits. As of now I've taken to closeting my bough and redefining my outfits that had the bough to use something else. Still running into occassional "you dont have that item" when i'm already using it errors, but it's MOSTLY functioning now.
 

Ferdawoon

Member
This is a problem with KoL itself, Mafia just relays the error message.
Yup, tested that without Mafia. Putting on an outfit where a part of it was used by the Disembodied Hand resulted in an error message that I might not have it.
Wierd though that I have never had that issue before. Last Basement dive was as a Moxieclass though so I guess the outfits behaved differently.
 

HasteBro

Member
I don't know if this has been presented before, but I wonder... why the heck does the script puts on loads of HP/muscle for elemental tests, instead of simply putting a elemental resistance outfit?

Here's and example of it doing it:
Code:
Elemental Resist Test: +14 hot 100% (1 hp), +14 spooky 82% (4,435 hp)
Basement level 459: Sleaze & Stench Elemental Resistance Test
Maximizing...
38048 combinations checked, best score 128.23
Putting on plexiglass pith helmet...
Equipment changed.
Wielding Brimstone Bludgeon...
Equipment changed.
Holding Brimstone Bunker...
Equipment changed.
Putting on sea salt scrubs...
Equipment changed.
Putting on Hodgman's lobsterskin pants...
Equipment changed.
Putting on depleted Grimacite weightlifting belt...
Equipment changed.
Putting on Uncle Hobo's epic beard...
Equipment changed.
Putting on Brimstone Bludgeon...
Equipment changed.
Searching for "phial of sleaziness"...
Purchasing phial of sleaziness (1 @ 380)...
You acquire an item: phial of sleaziness
Purchases complete.
Using 1 phial of sleaziness...
You acquire an effect: Sleazeform (duration: 10 Adventures)
Finished using 1 phial of sleaziness.
Maximizing...
1680 combinations checked, best score 127.229996
Searching for "philter of phorce"...
Purchasing philter of phorce (1 @ 370)...
You acquire an item: philter of phorce
Purchases complete.
Using 1 philter of phorce...
You acquire an effect: Phorcefullness (duration: 10 Adventures)
Finished using 1 philter of phorce.
Searching for "ben-gal™ balm"...
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 smoky potion of ettin strength...
You acquire an effect: Strength of Ten Ettins (duration: 10 Adventures)
Finished using 1 smoky potion of ettin strength.
Searching for "blood of the wereseal"...
Purchasing blood of the Wereseal (1 @ 500)...
You acquire an item: blood of the Wereseal
You spent 500 Meat
Purchases complete.
Using 1 blood of the Wereseal...
You acquire an effect: Temporary Lycanthropy (duration: 10 Adventures)
Finished using 1 blood of the Wereseal.
Searching for "mick's icyvapohotness rub"...
Purchasing Mick's IcyVapoHotness Rub (1 @ 282)...
You acquire an item: Mick's IcyVapoHotness Rub
Purchases complete.
Using 1 Mick's IcyVapoHotness Rub...
You acquire an effect: Extreme Muscle Relaxation (duration: 10 Adventures)
Finished using 1 Mick's IcyVapoHotness Rub.
Searching for "black facepaint"...
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"...
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.
Searching for "unstable dna"...
Purchasing unstable DNA (1 @ 970)...
You acquire an item: unstable DNA
Purchases complete.
Using 1 unstable DNA...
You acquire an effect: Yuletide Mutations (duration: 10 Adventures)
Finished using 1 unstable DNA.
unable to pass elemental test, quitting
Basement sucessfully automated for 15 out of 56 adventures.

After that I had 16k HP (much more than the necessary 4k at the beginning) and it wasted meat buying loads of unnecessary buffs.

Here's what Mafia without the script does:
Code:
Visit to Tower: Fernswarthy's Basement in progress...
Putting on outfit: Elemental Res
Equipment changed.

[16785] Fernswarthy's Basement (Level 459)
Elemental Resist Test: +15 stench 83% (4,314 hp), +14 sleaze 100% (1 hp)
You lose 4,042 hit points
You lose 1 hit point

Is this an issue people had before or is it some config I have?

EDIT: The weird thing is, it doesn't do that in all tests, the occurances have been on:

Code:
level 423: Hot & Spooky
level 426: Hot & Spooky
level 443: Hot & Spooky
level 459: Sleaze & Stench
level 476: Sleaze & Stench
level 481: Sleaze & Stench
 
Last edited:

Winterbay

Active member
Attached is a version of the script that won't crash if you have forgotten to open the basement (it will not inform you about this but will abort telling you that you are not in the basement), it should also solve the problem of hatrack/disembodied hand holding equipment that your outfit requires and then not working as intended.
It has been tested somewhat by Ferdawoon but more comments are always welcome.

Rinn: If you like anything feel free to implement it into the "real" version :)
 
I don't know if this has been presented before, but I wonder... why the heck does the script puts on loads of HP/muscle for elemental tests, instead of simply putting a elemental resistance outfit?

When I got to the 3,000 range of basement floors I started having this issue, where the script wasn't considering very basic elemental resistance and would get stuck, so I would manually need to use things like black paint and parrrlay
 

slyz

Developer
The script uses this:
Code:
maximize .5 elem1, .5 elem2, 0.01 hp
If that isn't enough, it uses an elemental vial, and maximizes only the other element:
Code:
maximize elem2, 0.01 hp
If that is still not sufficient, it will increase your HP with potions.

The script doesn't consider elemental resist potions.

Do you have some gCLI output?
 
Last edited:
Top