Show APM in the Ultra gamemode
当前为
// ==UserScript==
// @name Show APM in Ultra
// @namespace http://tampermonkey.net/
// @version 0.1
// @author Oki
// @description Show APM in the Ultra gamemode
// @match https://*.jstris.jezevec10.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.addEventListener('load', function(){
/**************************
APM in Ultra
**************************/
var loc=window.location.href
if(loc.endsWith("?play=5") || ~loc.indexOf("?play=3") || ~loc.indexOf("?play=1") ){
var apmStat= document.createElement("tr");
apmStat.innerHTML = '<td class="ter">APM</td><td class="sval"><span id="apms">0</span></td>'
aux2.parentNode.parentNode.insertBefore(apmStat, aux2.parentNode);
Game['prototype']['getAPM2'] = function() {
return ((this['gamedata']['linesSent'] / (this['clock'] / 60))).toFixed(2)
};
var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}
var updateTextBarFunc = Game['prototype']["updateTextBar"].toString()
updateTextBarFunc = "apms.innerHTML=this['getAPM2']();" + trim(updateTextBarFunc)
Game['prototype']["updateTextBar"] = new Function(updateTextBarFunc);
}
});
})();