Daily Dungeon Diver -- intelligent automation with NO-calendar-empowered prediction!

zarqon

Well-known member
[size=+1]Daily Dungeon Diver 1.9[/size]

NOTE: This script has been completely obsoleted by the Daily Dungeon revamp of 2013. You can now easily automate the Daily Dungeon using Mercenary Mood and adv * daily dungeon.

The Daily Dungeon is a frequent source of annoyance in people's runs.

"Gah! I'm ready to hit the Tower but I forgot to get my keys!"
OR
"Gah! I can't pass this test! I just wasted 5 adventures in here!"
OR
"Gah! I forgot to eat my key lime pies and I'm already full today!"
OR
"Gah! Which of these dang accessories has sleaze resistance again?"
OR
"Gah! What was the URL to Noblesse Oblige's Kingdom Calendar again?!"
OR
"GAH! ANOTHER Jarlsberg's earring!!"

For all but the last one, there's this script.

What does it do?
Daily Dungeon Diver loads the day's dungeon contents from the Noblesse Oblige calendar, determines whether or not you can pass all the Dungeon tests (based on current wiki data), and then proceeds to pass them all. If you can't pass any of the tests, it doesn't bother wasting any adventures there.

Details
  • DDD will use special items to attempt to open Locked Doors. In order of preference: Platinum Yendorian Express Cards (I don't have one so I would appreciate hearing if this works), lockpicks (if your Moxie passes the riskiness specified in statchance -- see below), and skeleton keys (but it holds one back for the tower).
  • DDD has a few settings which you can configure to get the best use of the script. After running the script at least once (you can abort it before it does anything), type "zlib vars" in the CLI to see the current value of these settings, and "zlib settingname = value" to change them.

    ddd_goal3 -- This allows you to specify an item that you want from the treasure chest in the 3rd room. It will only open the chest if you lack the item (or, in the case of the potato sprout, if you already have the Levitating Potato in your terrarium). Default is $item[potato sprout]. Specifying "none" will skip the chest.

    ddd_goal6 -- Same as previous, but for the treasure chest in room 6. You may want to use this to look for lockpicks.

    ddd_takeitintheface -- Whether or not to clear elemental test rooms even if you were unable to resist the element. If false, DDD will not attempt the dungeon if there is an elemental test you cannot pass. If true (default), you will take it in the face.

    ddd_dungeonblind -- Whether or not to adventure anyway in the event that the NO Kingdom Calendar information is unavailable. If ddd_dungeonblind is true, DDD will try to complete the Daily Dungeon even if it can't predict it. If false (default), it will abort if you can't load the NO data.

    ddd_statchance -- This is a spectrum from 1-3 of how risky you want it to be when attempting stat tests:
    • 1: Attempt when your stat is at least the lowest possible pass value (will require up to 5 attempts)
    • 2 (default): Only attempt when your stat is at least the mean of the pass/fail range provided on the wiki. This is likely to pass on the first or second effort.
    • 3: Only attempt when your stat is guaranteed to pass. Will always take only one adventure.

Acknowledgments
Special thanks to Ragnok (#49653) in Noblesse Oblige for his help in pointing me to the best way to access the daily dungeon data, which is not immediately apparent in the source of the site. Also, mad props to him for creating the Kingdom Calendar in the first place; it's a tremendously useful resource. Definitely send him some appreciation if you find this script useful.

How to use it:
  • Download dailydungeon.ash to your scripts directory.
  • Download dungeonstatchecks.txt to your data directory.
  • Make sure you have ZLib if you don't already.
  • Optionally, tweak any of the script settings as described above.
  • Run the script from within mafia. Users of my Hardcore Checklist need not even bother with this step -- this has been integrated and Checklist will now automatically handle getting your keys.

Changelog
4.08.09 - ver. 1.0 posted, followed shortly by a few extra lines to handle the potato sprout.
4.12.09 - 1.1 changes: there is now a "takeitintheface" variable specifying your preference on attempting elemental test rooms even if you were unable to gain resistance.
4.24.09 - 1.2 changes: show all rooms during pre-testing, even if a room fails the test.
5.26.09 - 1.3 changes: add a parameter to resist(), allowing you to determine whether or not you can achieve resistance without actually casting the spells. So currently you won't cast spells during testing.
5.28.09 - 1.4 changes: the new improved resist() function searches all of your gear and doesn't waste time swapping outfits unnecessarily when testing. And, it's smaller.
6.14.09 - 1.5 changes: moved out some functions -- now requires ZLib.
7.25.09 - 1.6 changes: use script settings rather than variables. Change default goal3 to potato sprout and default takeitintheface to true.
11.01.09 - 1.7 changes: police is_100_run setting. Moved a few things around to play better with being imported. Several other tweaks and code cleanups (smaller by 0.1K, w00t).
12.30.09 - 1.8 changes: convert to using ZLib's new vprint().
5.22.10 - 1.9 changes: ASH's new to_element() doesn't equate "heat" with "hot", so replace that before parsing the dungeon data.
 

Attachments

  • dungeonstatchecks.txt
    322 bytes · Views: 1,321
  • dailydungeon.ash
    14.4 KB · Views: 726
Last edited:

Muhandes

Member
I haven't tried this script yet, but I would appreciate it if I had an option to just tell me if I can do the dungeon safely, and if not, what am I missing.
 

Bale

Minion
I agree with Muhandes. Just let me know what will happen if I enter the dungeon. Tell me if it will use keys, tell me how many aventures it will take. Tell me what buffs I'd have to use.
 

zarqon

Well-known member
You haven't tried the script have you? It does that, then waits 10 seconds. If all you want is to see whether you can pass, it's easy to abort during those 10 seconds. Seriously, try it before you comment.

If you'd prefer only information, the code is very modular so it's quite easy to write your own main() that only checks the dungeon.
 

Bale

Minion
I admit that I didn't even try it just because I'm hesitant to use much automation that I don't comb through every line. I'll download it and take a look now. Sorry for miffing you off, Z.

Since I also don't like needing many data files I'll add about half-a-dozen lines to the main script so that I won't need it. (Short map file.)
 

Muhandes

Member
Sorry for being prudent, but I'm afraid that's how I'm built.

I gave it a try today, and it wont do the dungeon because I don't have cold resistance. I'm not sure how other people handle the dungeon, but personally I do it even if I don't have the resistances, since all it does is damage you and I can usually survive that.

Anyway, nice idea, thanks for writing this.
 

zarqon

Well-known member
Hmmmm, I did have that thought when I was writing it. I usually wait until I can resist it without needing to heal myself afterwards (I guess I'm prudent differently).

Would people be happy with an option (perhaps named "takeitintheface") specifying whether or not to pass elemental rooms regardless of resistance?
 

Bale

Minion
Well, it has been a long time since I've had to "take it in the face" since I have astral shell, but way back, I always used to consider healing to be a good option. You're differently prudent.
 

zarqon

Well-known member
Okay, there is now an additional boolean variable at the top called, unexpectedly, "takeitintheface", which specifies your willingness to take elemental damage from elemental test rooms. Enjoy!

@Bale: in my opinion, the more information is hard-coded in external maps, the less code mafia has to parse and the faster the script. Building a map every time you run a script irks my German sense of efficiency. :)
 

Bale

Minion
Okay, there is now an additional boolean variable at the top called, unexpectedly, "takeitintheface", which specifies your willingness to take elemental damage from elemental test rooms. Enjoy!

@Bale: in my opinion, the more information is hard-coded in external maps, the less code mafia has to parse and the faster the script. Building a map every time you run a script irks my German sense of efficiency. :)
I hadn't thought of it that way. It's only a few lines...

Code:
dchecks["Locked Door"] = new statrange ($stat[Muscle],29,51);
dchecks["A Hairier Barrier"] = new statrange ($stat[Mysticality],29,48);
dchecks["Piledriver"] = new statrange ($stat[Muscle],26,46);
dchecks["Smooth Criminal"] = new statrange ($stat[Moxie],28,44);
dchecks["The Mystic Seal"] = new statrange ($stat[Mysticality],25,41);
dchecks["Yet Another Troll"] = new statrange ($stat[Muscle],24,40);
dchecks["Badger Badger Badger Badger"] = new statrange ($stat[Moxie],26,38);
dchecks["Magic Shell"] = new statrange ($stat[Mysticality],19,29);
dchecks["The Biggest Bathtub Ever"] = new statrange ($stat[Muscle],17,30);
dchecks["Dungeon Fever"] = new statrange ($stat[Moxie],20,28);

... but I can understand your point. I'll just edit that into my own version since I don't mind a bit of slowdown for something I run only infrequently. It's less speed efficient, but also less file-cluttery.
 

dj_d

Member
I must admit, when I saw the subject line, I thought to myself:
Why the hell is Zarqon bragging about not implementing "calendar empowered prediction"?
 

Bale

Minion
I thought that at first also! LoL!

By the way, I've tried this script and it really is pretty cool. I'm going to adopt it as one of the very few automations I use with mafia. Thanks, Z.
 

Bale

Minion
Can I ask why it casts elemental protective spells when checking the dungeon, rather than waiting until you actually go into the dungeon? That's 10 MP wasted if I decide it's a bad day for spelunking.
 

zarqon

Well-known member
Because the resist() function (used both when testing and when actually spelunking) attempts to resist a given element, and returns true if the resistance was achieved.

I will add a "sim" parameter to that function when I kick this stupid flu.
 
I know the list of resistance items is not meant to be exhaustive, but is there any reason for leaving out lihc face? It's what I usually have available first for spooky resistance...

Thanks for the script!
 
Top