Eh, that's kind of a bit too wide, no? I mean, there's not a single item in the drop-down that's wider than "Deck of every card: ". As it is now, the card-count is almost entirely out of frame on the default panel on Windows, and I know it'll be a lot further out on my Linux machine (which I won't be on for a couple of weeks). In other words, the BLAHBLAH to widen the drop-down can probably be removed.
--- src/data/defaults.txt (revision 17293)
+++ src/data/defaults.txt (working copy)
@@ -1220,6 +1226,7 @@
user _deluxeKlawSummons 0
user _defectiveTokenChecked false
user _demandSandwich 0
+user _deckCardsCheated
user _detectiveCasesCompleted 0
user _dinseyGarbageDisposed false
user _discoKnife false
--- src/net/sourceforge/kolmafia/session/ChoiceManager.java (revision 17293)
+++ src/net/sourceforge/kolmafia/session/ChoiceManager.java (working copy)
@@ -238,8 +238,9 @@
private static final Pattern ENLIGHTENMENT_PATTERN = Pattern.compile( "achieved <b>(\\d+)</b> enlightenment" );
private static final Pattern ORACLE_QUEST_PATTERN = Pattern.compile( "don't remember leaving any spoons in (.*?)"" );
private static final Pattern CASE_PATTERN = Pattern.compile( "\\((\\d+) more case" );
private static final Pattern TIME_SPINNER_PATTERN = Pattern.compile( "have (\\d+) minute" );
private static final Pattern TIME_SPINNER_MEDALS_PATTERN = Pattern.compile( "memory of earning <b>(\\d+) medal" );
+ private static final Pattern DECK_OF_EVERY_CARD_CHEAT_PATTERN = Pattern.compile( "which=(\\d+)" );
public static final Pattern DECISION_BUTTON_PATTERN = Pattern.compile( "<input type=hidden name=option value=(\\d+)>(?:.*?)<input +class=button type=submit value=\"(.*?)\">" );
@@ -6681,6 +6701,23 @@
// The extra 1 will be covered in choice 1085
Preferences.increment( "_deckCardsDrawn", 4, 15, false );
}
+
+ if ( ChoiceManager.lastDecision == 1 && request.getURLString().contains( "which=" ) )
+ {
+ Matcher cheatMatcher = ChoiceManager.DECK_OF_EVERY_CARD_CHEAT_PATTERN.matcher( request.getURLString() );
+ if ( cheatMatcher.find() )
+ {
+ int cheatedCard = StringUtilities.parseInt( cheatMatcher.group( 1 ) );
+ String cardsCheated = Preferences.getString( "_deckCardsCheated" );
+ if ( !cardsCheated.isEmpty() )
+ {
+ cardsCheated += ",";
+ }
+ cardsCheated += cheatedCard;
+ Preferences.setString( "_deckCardsCheated", cardsCheated );
+ }
+ }
+
break;
case 1089: // Community Service
Can you cheat an option after randomly drawing it? If not, the tracking is a bit more complicated. Especially when some options take you directly to a combat.
Only tracking cheats is probably good enough, even if it isn't actually correct...
Revision 17390 adds a default of 1 to choice 1085. Having done that, "use 1 gift card" automates through fights and such, just as expected. (The fact that gift cards are now about 6K Meat in the mall made this easy to test,)One aspect that still appears to be missing, is utilizing the 'gift card'. The CLI doesn't automate through using the gift card.
So, someone mentioned in chat about having mafia track deck draws, I came up with something that seems ok (not that I know all of the implications of how ChoiceManager works). Could this be a thing?
So it seems that what we want to track is all cards you have seen today, whether by drawing or cheating.If you randomly draw it, you can't cheat it.
"Fast-play mode" is just animation. When you draw a card - either by play or cheat or a gift card, it shows you the card back. You can click and it will animate turning over the card. That animation is done by the browser in Javascript; it does not result in a request.All the draws appear to go to a card first and then you click through (I'm not sure what fast-play mode is, but I think that was just an animation?). So, I could put together a table of all of those results if someone wanted it. I'm not sure the current way that is handled in mafia as I am trying to match style as per the existing code.
[423886] gift card
Encounter: XXI - The World
You gain 500 Strengthliness
use 1 gift card
[423886] gift card
Encounter: Go Fish
Encounter: urchin urchin
Round 0: Tebryn wins initiative!
Round 1: Tebryn attacks!
Round 2: You lose 12 hit points
Round 2: Stubert climbs up and sits on your shoulder, and hands you some Meat. Huh, where did he find that?
You gain 56 Meat.
Round 2: Tebryn attacks!
Round 3: urchin urchin takes 2381 damage.
Round 3: Tebryn wins the fight!
After Battle: Wingwang whirls around picking up items, like a little couscous tornado.
You acquire an item: bazookafish bubble gum
After Battle: You gain 30 Strongness
After Battle: You gain 58 Magicalness
After Battle: You gain 18 Roguishness
use 1 gift card
[423887] gift card
Encounter: Two of Papayas
choice 1085/1: Grab 'em!
Took choice 1085/1: Grab 'em!
choice.php?whichchoice=1085&option=1&pwd
You acquire papaya (2)
use 1 gift card
[423887] gift card
Encounter: IX - The Hermit
Took choice 1085/1: You'll show him!
choice.php?whichchoice=1085&option=1&pwd
Encounter: The Hermit
Round 0: Tebryn wins initiative!
Round 1: Tebryn executes a macro!
Round 1: Tebryn uses the seal tooth!
Round 2: The Hermit takes 1 damage.
Round 2: You lose 1,031 hit points
Round 2: Tebryn uses the seal tooth!
Round 3: The Hermit takes 1 damage.
Round 3: You lose 869 hit points
Round 3: Tebryn uses the seal tooth!
Round 4: The Hermit takes 1 damage.
Round 4: You lose 1,248 hit points
Round 4: Tebryn uses the seal tooth!
Round 5: The Hermit takes 1 damage.
Round 5: You lose 1,248 hit points
You acquire an item: hermit factoid
I want to close this New Content thread.Veracity is on the case!