Combined dance card and absinthe power-moxie script

davidmac

New member
Hey all - my first try at ASH scripting. Cribbing heavily from the ballroom dancing script and from the not-a-pipe script posted here, I've created a combined script for using absinthe and dance cards in a 12-adventure cycle.

However, I've encountered some problems with the wormwood counter in 12.4 interfering with the ballroom adventures - it seems to occasionally get incorrect values for when the counter is expired, which causes it to skip ballroom adventures and get all confused about when the wormwood adventures should be chosen.

The code is intended to do the following:
Dance, get the wormwood boost, dance, get the 2nd wormwood boost, dance, get the 3rd wormwood boost, consume 2 extra adventures, then repeat. All non-required wormwood adventures are to be spent in the ballroom.

Two requests, then:
(1) Code sanity check - does this DWITISD?
(2) Can the Wormwood (and possibly semirare as well) counter be disabled in ASH scripting?

Thanks, and enjoy!

-David

Code:
void main( int cycles )
{
	// Set moxie bonuses for wormwood noncombats
    set_property( "choiceAdventure170", "3" );
    set_property( "choiceAdventure168", "1" );
    set_property( "choiceAdventure166", "2" );
	cli_execute("conditions clear");

	int cards = item_amount ( $item[dance card] );
	int bottles = item_amount ( $item[tiny bottle of absinthe] );
	if ((cards > 2) && (bottles > 0))
	{
		if (cards < (3 * cycles))
		{
			print ("More cycles than cards available - resetting");	
			cycles = (cards / 3);
		}
		if (bottles < cycles)
		{
			print ("More cycles than bottles available - resetting");
			cycles = bottles;
		}
		if ( my_adventures() >= (cycles * 12))
		{
			while ((cycles >= 1) && (my_adventures() >= 12))
			{

				print ("Starting cycle...");

				// Adventure sequence:
				// Use a bottle, ballroom (or dance), use a card, wormwood until stat bonus
				// Dance, then go back to the wormwood for a 2nd bonus
				// Dance again and collect the 3rd bonus, spend 2 extra turns, then start over.

				use(1, $item[tiny bottle of absinthe]);
				adventure(1, $location[Haunted Ballroom]);
				use(1, $item[dance card]);
				cli_execute("conditions add 1 choiceadv");
				int turns = my_adventures();
				adventure(3, $location[Rogue Windmill]);
				int turns_used = turns - my_adventures();
				adventure(4 - turns_used, $location[Haunted Ballroom]);
				use(1, $item[dance card]);
				cli_execute("conditions add 1 choiceadv");
				turns = my_adventures();
				adventure(3, $location[Mouldering Mansion]);
				turns_used = turns - my_adventures();
				adventure(4 - turns_used, $location[Haunted Ballroom]);
				use(1, $item[dance card]);
				adventure(1, $location[Stately Pleasure Dome]);
				adventure(2, $location[Haunted Ballroom]);
				cycles = cycles - 1;
			}
		adventure(1, $location[Haunted Ballroom]);
		} else { print ("Not enough adventures!"); }
	} else { print ("Couldn't find enough cards or bottles. Check again!"); }
}
 
Top