Over on the MMG Toolbox thread, I introduced the MMG Martingale script I wrote. I figured I should put it over here, rather than in "Scripting Discussion", since it's a real script, not just a proof of concept for the support I added to KoLmafia. I also include an MMG log parsing script I wrote which you may enjoy.
mmg.ash:
You can configure three things at the top of the script:
When you invoke the script, you will be prompted for 4 values:
amount - the amount of Meat to bet initially
factor - the amount to multiply the amount by if you lose. Traditional Martingale says 2.0, but increase it if you want to bankrupt yourself faster.
iterations - how many times to run each chain
chain_count - how many chains you want to run at once - from 1 to 5
mmg-log.ash:
This is also configurable:
When you run it, you are prompted for whether to load previously saved data or go to the mmg to fetch your two week full bet history (and save the data). It makes an HTML table of every player you played against, showing how many bets you made or took from each one, how many wins, how many losses, net winnings.
Have fun and good luck - unless you are playing against me.
Edit: I have souped up mmg-log.ash. It now generates two HTML tables. The first is, as before, the players you gambled against. The second has one row per day, showing you how you did each day during the last two weeks. Both tables now print numbers with commas separating the thousands and millions - much easier to read!
Edit: More improvements to mmg-log.
- Include player name in saved data files
- Configurable to show players and/or dates, rather than always showing both.
Edit: Moved functions to print numbers with commas into mmg-utilities.ash. Both mmg.ash and mmg-log.ash import that file.
mmg.ash:
You can configure three things at the top of the script:
Code:
// set to true if betting from storage
boolean storage = false;
// if your meat on hand exceeds this amount, closet the excess
int closet_threshold = 1000000;
// maximum loss count you will tolerate
int loss_threshold = 20;
When you invoke the script, you will be prompted for 4 values:
amount - the amount of Meat to bet initially
factor - the amount to multiply the amount by if you lose. Traditional Martingale says 2.0, but increase it if you want to bankrupt yourself faster.
iterations - how many times to run each chain
chain_count - how many chains you want to run at once - from 1 to 5
mmg-log.ash:
This is also configurable:
Code:
// set to true to see bet statistics by player
boolean show_players = false;
// set to true to see bet statistics by date
boolean show_dates = true;
// file names in which to save bet archives
string player_file_name = "bet-archive-players." + my_name() + ".txt";
string date_file_name = "bet-archive-dates." + my_name() + ".txt";
When you run it, you are prompted for whether to load previously saved data or go to the mmg to fetch your two week full bet history (and save the data). It makes an HTML table of every player you played against, showing how many bets you made or took from each one, how many wins, how many losses, net winnings.
Have fun and good luck - unless you are playing against me.

Edit: I have souped up mmg-log.ash. It now generates two HTML tables. The first is, as before, the players you gambled against. The second has one row per day, showing you how you did each day during the last two weeks. Both tables now print numbers with commas separating the thousands and millions - much easier to read!
Edit: More improvements to mmg-log.
- Include player name in saved data files
- Configurable to show players and/or dates, rather than always showing both.
Edit: Moved functions to print numbers with commas into mmg-utilities.ash. Both mmg.ash and mmg-log.ash import that file.
Attachments
Last edited: