Created
November 17, 2012 15:55
-
-
Save kkotaro0111/4097034 to your computer and use it in GitHub Desktop.
mobamas view status rate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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