Skip to content

Instantly share code, notes, and snippets.

@kkotaro0111
Created November 17, 2012 15:55
Show Gist options
  • Save kkotaro0111/4097034 to your computer and use it in GitHub Desktop.
Save kkotaro0111/4097034 to your computer and use it in GitHub Desktop.
mobamas view status rate
// ==UserScript==
// @match http://sp.pf.mbga.jp/12008305/*
// ==/UserScript==
//
(function viewRateOfCost(){
$("table").find("span:contains('コスト:')").parent().each(function(){
var t = $(this);
var text = t.text();
var ahead = t.find("span:contains('攻:')");
var ghead = t.find("span:contains('守:')");
var cost = text.match(/コスト:([0-9]+)/)[1] << 0;
var attack = text.match(/攻:([0-9]+)/)[1] << 0;
var guard = text.match(/守:([0-9]+)/)[1] << 0;
var arate = (attack / cost) << 0;
var grate = (guard / cost) << 0;
console.log(cost, attack, guard);
console.log(arate, grate);
console.log("-------------");
ahead.next().before("( " + arate + " )");
ghead.next().before("( " + grate + " )");
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment