Jump to content

Greasemonkey Script For The Merc Event


3 replies to this topic

#1 WILL WORK FOR AMMO

    Member

  • PipPip
  • Ace Of Spades
  • 36 posts

Posted 30 January 2015 - 01:53 AM

I didn't see anything that was counting the number of qualifying matches for the event so I made a Greasemonkey script for it:

// ==UserScript==
// @name		MWO_Jan2015chlng_count
// @namespace   wwfa
// @require	 http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// @include	 http://mwomercs.com/tournaments*
// @include	 https://mwomercs.com/tournaments*
// @version	 1
// @grant	   none
// ==/UserScript==
 
var v = $("h3.leftShim")[1];
var nWins = $("img[src='http://mwomercs.com/static/img/ui/input/tick.png']").size();
var nLosses = $("img[src='http://mwomercs.com/static/img/ui/input/error.png']").size();
 
if (v == undefined) {
  return;
}
 
var nEle = document.createElement("i");
nEle.innerHTML += " (Qualifying Matches: " + nWins + ")";
v.appendChild(nEle);


Just go to the page that lists the matches. It should look something like this:
Posted Image

#2 Joseph Mallan

    ForumWarrior

  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • FP Veteran - Beta 1
  • FP Veteran - Beta 1
  • 35,216 posts
  • Google+: Link
  • Facebook: Link
  • LocationMallanhold, Furillo

Posted 30 January 2015 - 02:25 AM

Looks a bit like this page...

Without the failed attempts.

Edited by Joseph Mallan, 30 January 2015 - 02:25 AM.


#3 Cyborne Elemental

    Member

  • PipPipPipPipPipPipPipPipPip
  • 3,980 posts
  • LocationUSA

Posted 30 January 2015 - 03:31 AM

Nice.

#4 Rhaythe

    Member

  • PipPipPipPipPipPipPipPipPip
  • Philanthropist
  • Philanthropist
  • 4,203 posts

Posted 30 January 2015 - 05:29 AM

Nice work.

Alternatively, if you're interested in just having the mwomerc page open, you can hit F12 to open a console and paste this:

$("img[src*='tick']").length

Edited by Rhaythe, 30 January 2015 - 05:31 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users