Jump to content

Loot Bag Calculator Tools (Script And Spreadsheet)


2 replies to this topic

#1 Horseman

    Member

  • PipPipPipPipPipPipPipPipPip
  • The Mercenary
  • The Mercenary
  • 4,737 posts
  • LocationPoland

Posted 09 May 2022 - 04:00 AM

Quote

Small PSA for those who don't know - the bags cannot be redeemed using the in-game event browser and must be opened through a redemption page on MWOMercs.com , typically linked through the event announcement. The most recent event as of this post is at https://mwomercs.com...s?t=202203lucky

Quote

Disclaimer: This post has been cleared with the moderators (who cleared it with PGI's web team).

Quote

Limitations: This script only summarizes the rewards you have personally earned, that you have already opened. It cannot tell you what's in closed bags, it cannot tell you the overall probabilities and it does not use or reveal any information that the page doesn't already provide as plain text (I mean, the totals could be calculated with a clay tablet if it came to that...). It also does not interact with the backend or make any use of network connectivity.


So you probably remember that there used to be a couple online calculators for loot bag totals - all of which appear to have died out by now.
A Redditor called jojoxy posted their own calculator script some years back ( https://redd.it/39pbzu ) which I've adopted as a starting point, then updated it to work with the current lootbag pages (it won't work for the 2017 summer Shoot 'N Loot and events that came before it because the page structure is different) and eventually heavily rewrote with some minor upgrades. This version will not just give you the totals of C-Bills, MC, GXP, GSP and Premium Time you've earned, but also a detailed breakdown of consumables, cockpit items and any other unique prizes PGI might come up with in the future.

I've tested it in Firefox, Chrome and Edge - should work in every Chromium- or Mozilla-derived browser, not sure how well others would handle it.

This is a bookmarklet version of the script. To use it, add a bookmark with the script code instead of the URL. Then on the loot bag redemption page, click the bookmark to get a summary of the bags you've opened:
Spoiler


(note: the bags show different text right when you redeem them and when you load the page where they are already redeemed; the script will work for the latter, so redeem all your bags and reload the page before you use it)

This is the full source code. You can run it by opening your browser's developer/debug tools (typically F12) and pasting this into the Console panel, or you can convert it to a bookmarklet using third-party tools ( eg https://mrcoles.com/bookmarklet/ ):
Spoiler


Feel free to modify and improve.

If you prefer a conventional spreadsheet, here's a Google Sheet that does the same: https://docs.google....dit?usp=sharing

To use it, copy it to your own Sheets using File -> Make a Copy, then clear the example values from the # and Contents columns (you can do that manually or by clicking the Big Red Button to run a macro that will do the same thing) and paste your own bag contents from the redemption page. This is, again, keyed to the values the bags display when the page is loaded with them already open, so make sure you've reloaded the page after redeeming the bags and before you copy their contents.

And, since I was asked about it earlier, there's a script to open all of your bags in bulk: https://redd.it/rujz6a

$(".reachButton,.bonusButton").each(function(i, e) { setTimeout(function() { e.click() }, i*300) } )


EDIT July 2022: Somehow the <BR>'s in the source code got converted into actual linebreaks, fixed

Edited by Horseman, 06 July 2022 - 01:52 PM.


#2 w0qj

    Member

  • PipPipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 3,614 posts
  • Google+: Link
  • Facebook: Link
  • LocationAt your 6 :)

Posted 06 July 2022 - 01:09 PM

Wow, thank you!!

Will give this a spin for this upcoming Event!

Question: do we have to finish the entire Event (Part1+2) to finish earning all loot bags and then activate your JS scrip?
(Or can we activate JS scrip to get some loot bags, do more Event to earn yet more loot bags, then activate JS scrip to get some loot bags, etc.?) ;)

#3 Horseman

    Member

  • PipPipPipPipPipPipPipPipPip
  • The Mercenary
  • The Mercenary
  • 4,737 posts
  • LocationPoland

Posted 06 July 2022 - 01:42 PM

View Postw0qj, on 06 July 2022 - 01:09 PM, said:

Wow, thank you!!

Will give this a spin for this upcoming Event!

Question: do we have to finish the entire Event (Part1+2) to finish earning all loot bags and then activate your JS scrip?
(Or can we activate JS scrip to get some loot bags, do more Event to earn yet more loot bags, then activate JS scrip to get some loot bags, etc.?) Posted Image

Both the calculator and the opener scripts can be used whenever. Obviously, they will only add up (or open) the bags you've earned.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users