Bug - Fixed MMG - Taking Bets Issue

PlasticLobster

New member
Sorry guys, I know KoL hates the MMG... But...

For years, the MMG code has been broken and unable to find bets to take. This is because several years ago, Jick (I assume) changed the text at the top of the page from "Last 20 Bets" to "Last 20 Fools and their Money."

The result is that ASH function mmg_offered_bets() always returns an empty list. It's expected to return actual bets that exist.

Here is a patch I've had sitting in my source tree for too long to justify not contributing it back.

I have it just check for "Last 20" instead of bothering to change it to "Fools and their Money" because who knows if he'll change it again.

I'm not sure what the actual procedure is for contributing code to KoLMafia, but I'm hoping someone with more experience will fold this in.

Code:
Index: net/sourceforge/kolmafia/session/MoneyMakingGameManager.java
===================================================================
--- net/sourceforge/kolmafia/session/MoneyMakingGameManager.java	(revision 19133)
+++ net/sourceforge/kolmafia/session/MoneyMakingGameManager.java	(working copy)
@@ -56,7 +56,7 @@
 	private static final Pattern PENDING_BETS_PATTERN = Pattern.compile( "Your Pending Bets:.*?<table>(.*?)</table>" );
 	private static final Pattern MY_BET_PATTERN = Pattern.compile( "<tr>.*?([0123456789,]+) Meat.*?betid value='(\\d*)'.*?</tr>" );
 
-	private static final Pattern RECENT_BETS_PATTERN = Pattern.compile( "(Last 20 Bets|Bets Found).*?<table.*?>(.*?)</table>" );
+	private static final Pattern RECENT_BETS_PATTERN = Pattern.compile( "(Last 20|Bets Found).*?<table.*?>(.*?)</table>" );
 	private static final Pattern OFFERED_BET_PATTERN = Pattern.compile( "<tr>.*?showplayer.*?<b>(.*?)</b> \\(#(\\d*)\\).*?([0123456789,]+) Meat.*?whichbet value='(\\d*)'.*?</tr>" );
 
 	// Babycakes (#311877) took your 1,000 Meat bet, and you lost. Better luck next time.
 
Last edited:

zarqon

Well-known member
Maybe this is why people keep using my old Martingale script from a decade ago, even though Veracity put out a script that used the shiny new ASH functions and ostensibly obsoleted it. To my confusion, I still get notifications from people using it (or some renamed variant of it) nearly every day.
 
Top