Veracity's Gingerbread City.ash

Revision 61 does that.

Code:
// There are several once-per ascension "quests" available in the
// Gingerbread City.
//
// "blackmail"				(7 days) gain a briefcase full of sprinkles
// "raygun"				(10 days) gain a sugar raygun
// "blackmail+raygun"			(14 days) both of the above
//
// You specify what you want to do at Noon and Midnight, using the
// appropriate properties, and if you also specify a quest, this script
// will detect where you are in your progress and will override one or
// both of those properties in order to progress in your chosen quest.
//
// On days when only one of the Noon or Midnight choices is needed to
// advance the quest, the other will use your configured setting.
//
// When you complete the quest, this script will recognize that and no
// longer override your Noon or Midnight choices.

string vgc_quest = define_property( "VGC.Quest", "string", "" );
I set VGC.Quest to "blackmail+raygun". When I ran the script, it validated the plan and printed this:

Code:
Day 5 of quest "blackmail+raygun"
Overriding noon choice: "robbery" -> "photo counter"
Overriding midnight choice: "high-end ginger wine" -> "Mysticality"
Adventure for 9 turns in Gingerbread Upscale Retail District
Looking for photo counter in the Gingerbread Upscale Retail District at noon.
Adventure for 9 turns in Gingerbread Upscale Retail District
Looking for Mysticality in the Gingerbread Civic Center at midnight.
Adventure for 10 turns in Gingerbread Upscale Retail District
After I ran the script, I no longer had fruit-leather negatives and gingerNegativesDropped was true. I ran configureVGC to have it display the current state of my settings and it printed this:

Code:
Day 6 of quest "blackmail+raygun"
Overriding noon choice: "robbery" -> "photo counter"
Overriding midnight choice: "high-end ginger wine" -> "Mysticality"
Adventure for 9 turns in Gingerbread Upscale Retail District
Looking for photo counter in the Gingerbread Upscale Retail District at noon.
Adventure for 9 turns in Gingerbread Upscale Retail District
Looking for Mysticality in the Gingerbread Civic Center at midnight.
Adventure for 10 turns in Gingerbread Upscale Retail District
So far, so good.

Note that this depends on various KoLmafia settings:

Code:
set gingerMuscleChoice=0
set gingerSubwayLineUnlocked=false
set gingerNegativesDropped=false
set gingerBlackmailAccomplished	false
For the blackmail quest

Code:
set gingerLawChoice=0
set gingerDigCount=0
For the raygun quest.

The first group only recently was set to reset on ascension. The second set does not reset on ascension, yet. I'll do that, by and by.

But, if you have run these quests and since ascended, you should reset them to the initial values, as shown, so that the script will understand where you are in the quests.
 
And that brings the current To-Do list to this:

Code:
// ***************************
//          To Do            *
// ***************************

// Bug: Handle running out of turns before completing the plan.
// Test: Setting clock ahead
//
// Allow script to start at the right time even after having spent turns
// in the Gingerbread City today
//
// Make Mood configurable
Suggestions welcome.
 
After running today's Gingerbread City plan, I get this for my current set of properties:

Code:
Day 7 of quest "blackmail+raygun"
Overriding noon choice: "robbery" -> "briefcase full of sprinkles"
Overriding midnight choice: "high-end ginger wine" -> "Mysticality"
Adventure for 9 turns in Gingerbread Upscale Retail District
Looking for briefcase full of sprinkles in the Gingerbread Civic Center at noon.
Adventure for 9 turns in Gingerbread Upscale Retail District
Looking for Mysticality in the Gingerbread Civic Center at midnight.
Adventure for 10 turns in Gingerbread Upscale Retail District
So far so good.

In other news, I decided to unboard my haunted doghouse and release my spooky wiener dog. His choice adventures came up twice during my Gingerbread City run and, since I'd configured the choices to my taste, the script ran the choices using their defaults and continued and was not disrupted at all by the unexpected choice adventures.

This script is looking pretty solid. I look forward to having it detect how many turns you have spent in the city today prior to running the script and carrying on at the appropriate place in the daily plan.
 
Revision 63 fixes a bug in the "blackmail+raygun" quest: a "min" was needed instead of a "max".

Today I got a teethpick and went to dig. This confirms that the raygun quest DOES reset on ascension. I recently submitted a KoLmafia revision to reset the tracking variables pn ascension - before confirming this - but now that I have confirmed it, I'm happy.
 
Malibu Stacey says that turtle taming adventures in the Gingerbread City take no adventures (as usual) but advance time. That sure seems like a KoL bug, since other similar adventures (Violet Fog, Ghostly Wiener Dog) do not advance time. But, this script has to account for that, in order to recognize when it is Noon and Midnight.

Revision 65 should recognize turtle taming adventures - assuming they are "generic" turtles, rather than special turtles crafted specifically for this zone. Malibu Stacey says that she got a turtle-shaped rock in the Retail District, so that seems likely.

(One would hope that the Sewers would have the irradiated turtle but, alas, that is not generic for "underground" zones.)

This revision requires at least revision 17981 of KoLmafia, since it requires my patch allowing plural constants to have comments in them.
 
Revision 67 lets you execute this script even after spending some turns today in the Gingerbread City. It will validate & execute your plan starting right after the last turn you spent there. Note that we can only determine what that turn is if you did your previous adventuring while KoLmafia was watching - either via executing a script (like this one) or in the Relay Browser.
 
Revision 69 has a few tweaks.

- We calculate the number of turns your plan will take and if you don't have enough turns left, we tell you and don't execute the plan. You can change your plan or gain more turns and rerun.
- If you get the upscale retail district, sewers, or extra turns city upgrade at noon, the script will allow you to use those features later in the same plan. This seems incredibly minor, since you get a city upgrade exactly once per character, and you can rerun this script even with some of your plan already executed (and it will pick up where you left off), but, whatever.
- I added a "candy" place to configureVGC. This advances the clock, spends 3 turns in the retail district, and then gets candy at the train station.
- (I tested advancing the clock in a plan. It works as intended.)

I also noted a bug. Yesterday I go the tattoo via this script. At the end of the run, it said:

Gained -97,059 sprinkles in 28 turns. Sprinkles/Adventure = -3,466
Cumulative = -20,752 sprinkles in 796 turns. Sprinkles/Adventure = -26

That's a little irritating. I manually added 100,000 sprinkles to VGC.TotalSprinkles and now my cumulative totals and SPA value are correct.

I think I will make the script not count the cost of things you buy. Maybe.

Here is the current To Do list.

Code:
// Bug: When you purchase things with sprinkles, we subtract the price
//     from the sprinkles you found, which makes your sprinkles/turn
//     figure misleading.
// Optionally allow executing partial plan if insufficient adventures.
//     If so, handle running out of turns before completing the plan.
// Make Mood configurable
 
Revision 70 tracks # of sprinkles spent in setting VGC.TotalSpent and does not dock your sprinkle earnings by sprinkles spent.
 
FYI the script won't stop when your semi-rare counter is up.

Code:
[11425] Gingerbread Sewers
Encounter: gingerbread alligator
Round 0: Malibu Stacey wins initiative!
Round 0: Malibu Stacey tries to steal an item! (auto-attack)
Round 1: You lose 69 hit points
Round 1: Malibu Stacey executes a macro!
Round 1: Malibu Stacey casts ACCORDION BASH!
Round 2: Malibu Stacey casts EXTRACT!
You acquire an item: Source essence (2)
Round 3: Malibu Stacey casts CONE OF ZYDECO!
Round 4: gingerbread alligator takes 450 damage.
Round 4: Malibu Stacey casts CONE OF ZYDECO!
Round 5: gingerbread alligator takes 448 damage.
Round 5: Malibu Stacey wins the fight!
You acquire an item: sprinkles (96)
After Battle: You pull out your smartphone to see what time it is. It's late afternoon.
After Battle: Benji Toblerone frolics about chaotically, yipping and yapping.
You acquire an item: lucky cat's paw
After Battle: You gain 67 Beefiness
After Battle: You gain 73 Magicalness
After Battle: You gain 212 Smarm
[COLOR="#FF0000"]Fortune Cookie counter expired. Last semirare found 176 turns ago (on turn 11249) in The Castle in the Clouds in the Sky (Top Floor)[/COLOR]

[11426] Gingerbread Sewers
Encounter: gingerbread alligator
Round 0: Malibu Stacey wins initiative!
Round 0: Malibu Stacey tries to steal an item! (auto-attack)
Round 1: Malibu Stacey executes a macro!
Round 1: Malibu Stacey casts ACCORDION BASH!
Round 2: Malibu Stacey casts EXTRACT!
You acquire an item: Source essence (2)
Round 3: Malibu Stacey casts CONE OF ZYDECO!
Round 4: gingerbread alligator takes 448 damage.
Round 4: Malibu Stacey casts CONE OF ZYDECO!
Round 5: gingerbread alligator takes 450 damage.
Round 5: Malibu Stacey wins the fight!
You acquire an item: sprinkles (95)
After Battle: You pull out your smartphone to see what time it is. It's late afternoon.
After Battle: Benji Toblerone frolics about chaotically, yipping and yapping.
After Battle: You gain 61 Muscleboundness
You gain a Muscle point!
After Battle: You gain 78 Wizardliness
After Battle: You gain 215 Chutzpah

Which also screws the counter as I didn't get the second non-combat.

Code:
> call scripts\Gingerbread City.ash

Adventure for 9 turns in Gingerbread Sewers
Look for "candy" in the Gingerbread Train Station on turn 10
Adventure for 9 turns in Gingerbread Sewers
Look for "fancy chocolate sculpture" in the Gingerbread Upscale Retail District on turn 20
Adventuring in The Gingerbread City stops.
Farming sprinkles

It ran 9 in Sewers, 1 in Train Station (Candy NC) then 8 in Sewers when the Fortune Cookie confirmation would've shown up (it was at 12 when I started the script) and then fought one Gingerbread Tech Bro in the Upscale Retail District. I then manually clicked through the Midnight NC at Upscale Retail District.
 
Last edited:
Apparently you don't have a Counter Script to handle your semirare.

Personally, I would be annoyed if it stopped for a semirare and I had to restart it - especially since another script that calls this one wouldn't know that it didn't actually complete. I'm inclined to say that if you don't set a Counter Script, this script SHOULD ignore any and all counter warnings.

I don't understand your statement that "then 8 in Sewers when the Fortune Cookie confirmation would've shown up (it was at 12 when I started the script) and then fought one Gingerbread Tech Bro in the Upscale Retail District" since the session log fragment you showed was alligator, fortune cookie warning, alligator.

In any case, it looks like a red "counter expired" message will punt before actually submitting an adventure. Presumably, the visit_url() returned a blank page - and the script counts that as taking a turn. It should not do that.
 
Revision 76 does not assume that an unexpected non-combat/non-choice spent a turn in the Gingerbread City.
 
I think I forgot my principle that not everybody wants to run the way I do.

Revision 77 adds the following:

Code:
// Should we abort the script for an unexpected NC (presumably a counter)?
//
// Ideally, you'd set up a Counter Script and it would handle it and
// allow the script just continue, but if you want this script to abort
// to let you to handle the counter manually, set this to true. You can
// continue the script by simply running it again.

boolean vgc_abort_for_counters = define_property( "VGC.AbortForCounters", "boolean", "false" ).to_boolean();
I haven't actually tested this yet, although I will after rollover.
What could go wrong? :)
 
Yeah, it works. If you set that property to true, it stops on the semirare counter and tells you to run the script again when you have dealt with the counter.
 
Code:
> call scripts\Gingerbread City.ash

Advance the clock by five minutes
Adventure for 3 turns in Gingerbread Upscale Retail District
Look for "candy" in the Gingerbread Train Station on turn 5
Adventuring in The Gingerbread City stops.
That plan requires 6 turns but you only have 4 left.

It actually only uses 3 turns. Where it gets 6 from I have no idea. There's only 5 things it's doing so even if it was somehow counting the NC's as costing turns it still pulls another from somewhere.
 
Code:
    // Make sure we have enough turns left to execute the plan
    int available = my_adventures();
    int needed = vgc_last_turn - vgc_ginger_turns_used;
    if ( available < needed ) {
	// *** Perhaps user_confirm() to allow executing partial plan.
	string message = "That plan requires " + needed + " turns but you only have " + available + " left.";
	print( message );
	return;
    }
It doesn't account for non-combats being free. I'll fix it, by and by.
 
Hey! Trying to run the script but its having trouble equipping outfits with foldable items that are not in their required state.
 
I'm probably just being an idiot by not working this out, but whenever I try to run the script, it just displays the following:

"Adventuring in The Gingerbread City stops.
Farming sprinkles
Gained 0 sprinkles in 0 turns. Sprinkles/Adventure = 0
Cumulative = 0 sprinkles in 0 turns. Sprinkles/Adventure = 0
Spent 0 sprinkles. Cumulative = 0"

Nothing I do seems to be making it actually adventure. Anyone have any idea why?
 
The script has a big section in the front labelled "Configuration" which tells you which settings you need to think about.
You can also choose a "quest", which will override noon and/or midnight, as appropriate, to do certain things for you.

The script comes with a configureVGC.ash script which lets you choose a "plan". It prompts you. If you don't select one, it prints your choices and tells you what you have now. It says this for me:

Code:
Available plans:

alligators - bigger alligators, adventure in sewer
candy - advance clock, adventure in retail district, get candy
gingerbeard - adventure in retail district, banish tech bro
gingerservo - adventure in industrial zone, banish mugger
robbery - activate vigilantes

VGC.AdvanceClock=false
VGC.Morning=Gingerbread Upscale Retail District
VGC.Noon=candy
VGC.Afternoon=Gingerbread Upscale Retail District
VGC.Midnight=counterfeit city
VGC.Night=Gingerbread Upscale Retail District
VGC.Banishes=gingerbread tech bro
VGC.AbortForCounters=false
VGC.Outfit=Gingerbread City
VGC.Familiar=Chocolate Lab
VGC.Quest=blackmail+raygun

Validating current plan using today's remaining turns (1-30):
Day 1 of quest "blackmail+raygun"
Overriding midnight choice: "counterfeit city" -> "Muscle"
Adventure for 9 turns in Gingerbread Upscale Retail District
Look for "candy" in the Gingerbread Train Station on turn 10
Adventure for 9 turns in Gingerbread Upscale Retail District
Look for "Muscle" in the Gingerbread Train Station on turn 20
Adventure for 10 turns in Gingerbread Upscale Retail District
Adventuring in The Gingerbread City stops.
 
Revision 111 should do something reasonable if your Hallowiener Dog shows up at Noon or Midnight.

Which is to say, it will take whatever option you have configured for the dog and will try again for your Noon or Midnight choice.

The dog does not take a turn and does not seem to advance time in the Gingerbread City, unlike turtle taming.
 
Thanks for the script.

I thought it bears mentioning. If you want to manually customize the settings after using the configuration option to set a plan, then us the CLI command
Code:
set VGC.Outfit = gingerbread
where gingerbread is the setting I want, and VGC.Outfit is an example variable to change.
you will know it worked if mafia then prints
Code:
VGC.Outfit => gingerbread

---
also, would be great if there was an option to specify a separate outfit for enlarged alligator fighting. Since they are quite tough

---
also, I suggest the script abort in case you lose a combat by taking more than 30 rounds. (wasted 2 adventures in sewers before catching it and manually aborting, happened because i forgot to adjust my CSS). maybe also a CSS setting for which CSS to use with it?

---
for queue manipulation, gingerbread is pretty limited. You have licorice rope that banishes only the people. Insta kills actually advance time even if they don't take adventures. And any form of olfaction and banish does not work.
However, I found a queue manipulation thing that does work, macrometeorite
http://kol.coldfront.net/thekolwiki/index.php/Macrometeorite
Lets you switch which enemy you are facing, without costing any extra gingerbread time.
Just in case you want to integrate it into the script. (oh, idea! it could be handled via the CSS! just set it to use macrometeorite if encountering pigeons or rats! would go well with the setting of a CSS name for use with this script)
 
Last edited:
Back
Top